Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

newbie80

macrumors member
Original poster
Mar 2, 2011
51
0
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.
 
Last edited:

jnoxx

macrumors 65816
Dec 29, 2010
1,343
0
Aartselaar // Antwerp // Belgium
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

macrumors member
Original poster
Mar 2, 2011
51
0
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.
 

PhoneyDeveloper

macrumors 68040
Sep 2, 2008
3,114
93
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

macrumors member
Original poster
Mar 2, 2011
51
0
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. :)
 
Last edited by a moderator:
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.