Reyjohn
Reyjohn

Reputation: 2733

View doesnt navigate in real ipad device but works fine in emulator

In a button click I am navigating the view to another xib which works fine in real iphone device, ipad iphone both emulators but not in real ipad. Here is my code :

-(IBAction)cardAnimation{
ViewController_ipad *view = [[ViewController_ipad alloc]initWithNibName:@"ViewController_ipad" bundle:nil];

[self.navigationController pushViewController:view animated:YES];
}

but one thing to be noticed that I have done NSLog in my destination class's viewdidload method and surprisingly that thing is being logged though that view is not being loaded at all by the above code. What can be the problem?

Upvotes: 2

Views: 261

Answers (4)

Erfan
Erfan

Reputation: 1304

I think you have a MainWindow~ipad.xib file that is referenced through your AppDelegate and you also tried to alloc the Window in your didFinishLaunchingWithOptions: method in your AppDelegate file. For which there might be some problem occurred. Whenever you are trying to push your navigation controller, it is actually pushing, but not showing the next controller may be because of the Window over that controller.

It might solve your problem:

Go to your Project settings (not through File->Project Settings) by clicking on your Project at the left panel/navigator -> select your TARGET and go to Summary Tab -> scroll down to iPad deployment Info -> there you'll find the Main Interface option -> remove the name "MainWindow_iPad" and left it empty and save it. Run the application in your iPad and it will work fine.

Best of luck. :-)

N.B: Don't forget to clean your build and remove the application from your device before you go for the new build.

Upvotes: 3

Rajneesh071
Rajneesh071

Reputation: 31091

I faced the same problem, i had problem with my iPad (iOS 5.1.1).

When i was pressing button but that was not responding.

That is because of i added UIGestureRecognizer on self.view.

I solved this problem by adding gestureRecognizer on my button. (its just trick not an proper solution, Just implement it if you did not find any other way.)

Upvotes: 0

Undo
Undo

Reputation: 25697

The iPhone simulator is case-insensitive for file names. The devices are case- sensitive. Check to make sure that your nib name isn't actually Viewcontroller_ipad or ViewController_iPad or another variation. This behavior once got me trying to use an image file in my app - it would work in the Simulator, not on device.

Upvotes: 1

Jack Freeman
Jack Freeman

Reputation: 1414

Try a fresh install (deleting the app), and if you are building from xcode hold Option and go to Product - > Clean Build Folder

Also are you naming your nibs with ~iphone and ~ipad?

Upvotes: 0

Related Questions