I am using XCode 4.2 to develop an application for iPhone and iPad
I am loading a view using the following function
-(IBAction)button{
...
SettingsView *hello ;
hello= [[SettingsView alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:hello animated:YES];
}
on the simulator the view is loaded perfectly . but when I load the app on a real iPhone , I get a white screen and cannot go back to the app … any reasons ?
The most common cause of this kind of problem is a case mismatch. since you passed
nilas the name, it’ll try to loadSettingsView.nib. If your file is calledSettingsview.nib(note the “v”), then that will work on Mac (most of the time, and simulator) but not on iOS. By default, Mac has a case-insensitive filesystem. iOS always has a case-sensitive file system.After you’ve built for device, go to
~/Library/Developer/Xcode/DerivedDataand find your project output. Dig down into the Products directory and make sure that your nib file is really there and named what you expect.