views:

82

answers:

3

Hi all,

I have an already running iphone app with target OS 3.1. I am trying to transform it into a universal app. I am not going to change the model, only the xib. So I wrote the ipad xib in IB, then I went to info.plist and add MainIpad Nib for ipad pointing to a proper MainIpad.xib. I also set Target Device Family in project info to ipad/iphone.

That seems to be not enough, whenever I run ipad simulator, I always get the MainIpad.xib view resized as iphone, actually it's just showing an iphone inside an ipad. I also tried to set the CGRect manually to the ipad size. The result is a bigger view still clipped into an iphone.

Can you point out what I am doing wrong and suggest the proper way to convert in universal app ?

thanks

A: 
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad){
    if(!settingsController)
        settingsController = [[SettingsController alloc]initWithNibName:@"ipadSettingsController" bundle:nil];
    [self.navigationController pushViewController:settingsController animated:YES]; 
    [settingsController release];
}else {
    if(!settingsController)
    settingsController = [[SettingsController alloc] initWithNibName:@"SettingsController" bundle:nil];
    [self.navigationController pushViewController:settingsController animated:YES]; 
    [settingsController release];
}
RakeshBhatt
I don't think User Interface Idiom works in os 3.1, I will check but I can sort it out in a different way. But I don't understand, where do I need to put such code ? You are telling me that I need to write a new controller for every new ipad xib created ? And what new code should I put in there, in addition to existing one ?
Leonardo
sorry, misunderstood. It's not a new controller, but a new view, I am already doing it. The problem lies somewhere else, the ipad view get properly find and loaded, but it always get clipped into iphone view.
Leonardo
use the another xib which is targeted for ipad.
RakeshBhatt
A: 

use the another xib which is targeted for ipad.

RakeshBhatt
A: 

Can you point out what I am doing wrong and suggest the proper way to convert in universal app ?

The proper way? That's easy. From page 20 of the iPad Programming Guide:

Important: You should always use the Upgrade Current Target for iPad command to migrate existing projects. Do not try to migrate files manually.

By your problem description, it looks like you tried to migrate the files manually.

My advice to you is: start over using a copy of your project before you started the migration. (You did save a copy of the project before you started the conversion, like a good programmer should do, right?)

Shaggy Frog
Yes, the project was on svn, so no problem in that sense. But rather than going back to versioning, it has been enough to go to in project info-->architectures, and delete all unecessary entries. Then convert target again. And the problem disappeared...but the original advice was right :-)
Leonardo