PDA

View Full Version : Need help: xcode 4 - simulation for iphone or ipad




newbie80
Mar 30, 2011, 12:26 AM
Hi,

I'm new to xcode 4, I use my current project file xcode 3.1.3 and I open it in xcode 4 and run. My MainWindow.xib in Interface Builder is still iphone size, whereas I adjusted my other view in ipad size (1024 x 768). In my BUILD SETTINGS for my PROJECT and TARGET, I set the "Targeted Device Family" to iphone/ipad.

When I run the ipad simulator, it looks good and fit into the ipad screen. But when I run it in iphone simulator, the screen doesn't fit in and also has been cropped by iphone view. I thought if you made the ipad size, and if you transfer to iphone, it will auto adjust?

Or maybe I miss something in settings? Hope anyone could help me here. Thanks.



jnoxx
Mar 30, 2011, 02:49 AM
Close.
U need 2 seperate XIB files :)
it won't autoresize, it will auto load the right XIB files according to what Device it's building on :)
How to do that exactly, don't really have a clue, since i mostly have 2 different projects.
But I think if u create a new universal project, u can check how they do it, and mimick that in your project, good luck :)

newbie80
Mar 30, 2011, 03:03 AM
Close.
U need 2 seperate XIB files :)
it won't autoresize, it will auto load the right XIB files according to what Device it's building on :)
How to do that exactly, don't really have a clue, since i mostly have 2 different projects.
But I think if u create a new universal project, u can check how they do it, and mimick that in your project, good luck :)
Thanks jnoxx,
I was pulling my hair out.
Just now I tested two different files, one for iphone, one for ipad, and display on both devices also didn't show the auto sizing thing.

Then I need to find out.

jnoxx
Mar 30, 2011, 03:19 AM
Well, your project doesn't automaticly knows, which XIB is for what device, that's what u need to find out ^_-
And u clicked ur topic as resolved already?

PhoneyDeveloper
Mar 30, 2011, 11:51 AM
When you want to update a project for iPad you should use the Upgrade Target for Ipad menu item. That's in Xcode 3, not sure where it is in Xcode 4.

It's quite possible to use a nib for both iPhone and iPad. It depends on the content of the nib. The nib's view will be resized when it's loaded based on the strings and strut settings for the top-level view.

newbie80
Mar 30, 2011, 07:25 PM
Well, your project doesn't automaticly knows, which XIB is for what device, that's what u need to find out ^_-
And u clicked ur topic as resolved already?

I set it back to unresolved :P

When you want to update a project for iPad you should use the Upgrade Target for Ipad menu item. That's in Xcode 3, not sure where it is in Xcode 4.

It's quite possible to use a nib for both iPhone and iPad. It depends on the content of the nib. The nib's view will be resized when it's loaded based on the strings and strut settings for the top-level view.

Hi PhoneyDeveloper,

I tried to find the upgrade target for iPad menu item, but I couldn't find it on menu toolbar. Would you mind to tell me where is it? Thanks. :)