IOS 5 Crash # [self.navigationController pushViewController:vcSummary animated:YES ]; - iphone

[self.navigationController pushViewController:vcSummary animated:YES ]; is leading to my application crash (which is already in app store) on device, but working perfectly on my iPhone 5.0 simulator.
Please suggest is there any way to find out why crash is happening?
How to debug on iPhone i.e can i run application on iPhone and see the logs on iPhone itself?
Code:-
AirportInfoSummaryController *vcSummary = [[AirportInfoSummaryController alloc] init];
[self.navigationController pushViewController:vcSummary animated:YES ];
AirportInfoSummaryController has a table view with each row loaded with a table view cell (three rows have 3 xib's loaded)
Crash Log I am Getting:-

You can view the device logs through Xcode > Organiser > Devices. You can also symbolicate your crash logs there, assuming that you did build and archive and thus the dSYM file still exists. (Symbolication links the 'gibberish' that the crash log outputs to actual lines of code to help you debug.)

Related

Old XIB is loaded every second time I load my app?

I have a very strange problem.
Sometimes when I launch my app (on iPhone device or in Xcode iOS 5.1 Simulator) I got an old version of the XIB I'm doing changes with. Anyone have any tip on what could be wrong?
Here is the code from where i launch the XIB:
MapKitDragAndDropViewController *spview = [[MapKitDragAndDropViewController alloc] initWithNibName:nil bundle:nil];
[self presentModalViewController:spview animated:YES];
Found the problem! I had two xib-files. One for iPhone and one for iPad version. Both had same name. removed one because the view suits both formats.
Did you try cleaning your project?? Also remove the app from device/simulator and clean and try installing it again.

application crash due to navigate to different views

My application crashes when I navigate to different view for more than 10 to 11 times. I mean I have 6 buttons on main screen which on pressing bring you to different views. when I press these buttons repeatedly then my app crashes. I have spent 3 days but comes up with no solution. here is the code where app crashes
when i uncomment release statement then it crashes after first time.
-(IBAction) goToLiveAlerts{
teamAlerts *showLiveAlerts=[[teamAlerts alloc] initWithNibName:#"teamAlerts" bundle:nil];
[self.navigationController pushViewController:showLiveAlerts animated:YES];
//[showLiveAlerts release];
}
when i uncomment then i console error is
"wait_fences: failed to receive reply: 10004003
[Switching to process 2093]
[Switching to process 2093]
Program received signal: “EXC_BAD_ACCESS”."
-(IBAction)goToPhotos{
picturesGallery *showPictures=[[picturesGallery alloc] initWithNibName:#"picturesGallery" bundle:nil];
[self.navigationController pushViewController:showPictures animated:YES];
//[showPictures release];
}
Do you use ARC or not? If not, according to your code, there is some memory leaks in your code, try this:
-(IBAction)goToPhotos{
picturesGallery *showPictures=[[picturesGallery alloc] initWithNibName:#"picturesGallery" bundle:nil];
[self.navigationController pushViewController:showPictures animated:YES];
[showPictures release];
}
Anyway, you need to provide more code crash log.
According to your crash log, EXC_BAD_ACCESS means there is some memory leaks. Enable NSZombie in Xcode to debug. In Xcode 4.3, go to Product->Edit Scheme->Diagnostics and check Enable Zombie Objects.

App Rejected for failing to launch? ...and others

My game was just rejected from the AppStore for the following two reasons...
We found that your app failed to launch on iPhone 4 running iOS 5.1,
on both Wi-Fi and cellular networks.
We encountered the issue when selecting the application on the Home
screen - the app displayed a launch image then quit unexpectedly
And
Your app did not run at iPhone resolution and/or 2x iPhone 3GS resolution when reviewed on iPad.
Both of these confuse me, I currently do not have Lion installed so cannot test in 5.1 but, it works just fine in 5.0.1 and below.
Also, I have been testing on only my iPad, have no iphone to test on, but the game and graphics run just fine on the iPad. Though! I only have graphic files labeled #2x.png, and none with out it. Could that be the problem here?
If anyone has any advice that would be awesome, I responded to apple's rejection, but i bet it takes a while for them to get back to you, and i'd really like to move this along. Thanks!
**Updated
My didFinishLaunchingWithOptions:
Is as follows
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
// Override point for customization after application launch.
[[UIApplication sharedApplication] setStatusBarHidden:YES withAnimation:NO];
mainMenu = [[MainMenu alloc] init];
self.navController = [[UINavigationController alloc] initWithRootViewController:mainMenu];
self.navController.navigationBar.hidden = YES;
[self.window addSubview:navController.view];
[self.window makeKeyAndVisible];
[[GCHelper sharedInstance] authenticateLocalUser];
if ([[[NSUserDefaults standardUserDefaults] objectForKey:#"missingWordsAdded"] intValue] != 1) {
[self forceAddWords];
}
if (![[NSUserDefaults standardUserDefaults] objectForKey:#"EnableSoundEffects"]){
[[NSUserDefaults standardUserDefaults] setObject:#"YES" forKey:#"EnableSoundEffects"];
}
return YES;
}
GCHelper sets up GameCenter. thanks!
I've got a few suggestions:
Do a reset on your simulator, launch your program and see if it works
Uninstall your app from iPad, run it from Xcode and see if it works
Ask a friend to test an ad-hoc copy, or attach to your Xcode and run debug copy
Depending on your implementation, you should do some blind check on your startup code (didFinishLaunchingWithOptions or singleton instances). Especially those area that involves GCD, #synchronize, access on NSArray or NSDictionary. And things like default preference initializing and database creation are likely to produce this kind of problem.
Regarding the review process, my log indicates that Apple staff at Cupertino uses an iPad 2 with WiFi connection to run your app. They are not toying with you if they say they can't run your app.
1) "app failed to launch" for different configurations of phone and iOS is a big issue to reproduce because you may not have all the phones with different iOS versions at hand. You can try https://testflightapp.com/ for example, and can come to know your app performance with different configurations.
my app is also rejected for same reason. here u have first check the internet connectivity where it will needed than u have do your code.
to check internate connectivity u can use reachability classes.

MFMessageComposeViewController on Simulator - canSendText?

following situation: I want to send in app SMS. This is my code creating the MFMessageComposeViewController:
-(void) showMessageComposerWithText:(NSString*)messageText telNumber:(NSString*)telNumber composeDelegate:(id)delegate
{
MFMessageComposeViewController *controller = [[MFMessageComposeViewController alloc] init];
if([MFMessageComposeViewController canSendText])
{
controller.body = messageText;
controller.recipients = [NSArray arrayWithObject:telNumber];
controller.messageComposeDelegate = delegate;
[delegate presentModalViewController:controller animated:YES];
}
}
So I think this is straight forward. When testing in Simulator I get following exception: Application tried to push a nil view controller on target <MFMessageComposeViewController: 0x8a4e090>. I'm also wondering myself why [MFMessageComposeViewController canSendText] returns YES when running the app in the simulator.
When running on the device, everything is working correctly.
I couldn't find anything in the docs/web concerning this strange behavior.
I'm running Xcode 4.3 on OS 10.7.3, Deployment Target is iOS 5.0.
Thanks in advance,
tubtub
This problem occurs when you install Messages beta on OS X Lion.
Edit: It also occurs on Mountain Lion when there is an iMessage account configured and enabled. If the account is disabled, it works correctly (canSendText returns NO).
Tip: If you use controller.modalTransitionStyle = UIModalTransitionStylePartialCurl, you can go back in Simulator by clicking on the curled "page" in the upper left corner.
The simulator should always return NO from the canSendText, this isn't the case for the iOS 5.0 and 5.1 simulators. With Xcode 4.2 it crashed, on Xcode 4.3 it just pushes a nil view controller.
I'm seeing the same thing. I think it's a bug in the iOS 5 simulator with Xcode 4.3. canSendText correctly returns NO in the iOS 4.3 simulator. The same code works fine on the device.
With this configuration, canSendText returns correctly NO in the simulator (plus, a UIAlertView appears to say text messaging is not available):
Mountain Lion
Xcode 4.4,
iOS 5.1

Adding iPad XIB/VIEW to a "View Based Application" in iOS 4

I've created a View Based Application in XCode4 and trying to do the code and UI design according to the way Apple have intended it to be.
So I designed the UI in the AppNameViewController.xib and it works fine; now I want to enable it as a UNIVERSAL application that runs on iPad as well. I changed the App-Target>>Summary>>Devices from iPhone to Universal and miraculously XCode had automatically created MainWindow-iPad.xib (Apple, very nice...), but since I designed the application first screen on the AppNameViewController.xib and not on the MainWindow.xib when I run the app on iPad Simulator I get this ugly screen where my UI objects size and location is distorted (their size is still set for iPhone so they are all crumbled on the left-top corner of the screen).
In my previous app I used the code appearing below to distinct between the AppNameViewControllerForIPHONE.xib and the AppNameViewControllerForIPAD.xib; It was done from the AppDelegate.m file, but in the new XCode View Based Application template the AppDelegate doesn't go through initWithNibName method at all.
Code I used on XCode 3 that cannot be used on XCode 4:
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
viewController = [[AppViewController alloc] initWithNibName:#"AppViewControllerIPAD" bundle:[NSBundle mainBundle]];
}
else {
viewController = [[AppViewController alloc] initWithNibName:#"AppViewControllerIPHONE" bundle:[NSBundle mainBundle]];
}
Long question... still, anyone had any idea how it should be done here? Where should I design the iPad UI or is there a way to easily transform the iPhone xib to an iPad one?
You have to follow the new naming scheme (idiom in Apple-speak) specified for Universal Applications for the NSMainNibFile key in your info.plist. For example, if you set your NSMainNibFile to be "MainWindow-iPhone", the xib for ipad would be "MainWindow-iPad".
The same naming convention should hold for the views in a view based application (I can't test right now, installing new xcode).