This is my code in AppDelegate
iMapView = [[iMapViewController alloc] init];
if(UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPhone)
{
CGSize result = [[UIScreen mainScreen] bounds].size;
if(result.height == 568)
{
iMapView.view.frame = CGRectMake(0, 0, 568, 320);
}
}
[viewController.view addSubview:iMapView.view]; // crashing here
I turn on NSZombie and found the problem:
[iMapViewController searchDisplayController]: message sent to deallocated instance 0xd81d740
But i have never ever use searchDisplayController
or its delegate anywhere.
@interface iMapViewController : UIViewController<UIAlertViewDelegate>
It only happen in iOS 7 with non-ARC.
Could you please give me some advice?
Thank you
Once do this, don't make a global instance of your view controller.
iMapViewController *newObject = [[iMapViewController alloc]initWithNibName:@"iMapViewController" bundle:nil];
May be you are releasing your iMapView and accessing it again.