views:

81

answers:

2

Hey

I m still facing the problem when I launch my application in iphone.

It shows the stack over flow by presentModelViewController bcoz I m using number of viewcontroller and calling the same viewcontroller from other viewcontroller but it gets terminated.Here I m showing the code which I m using in whole program to call other view controller

UV_AlarmAppDelegate *app7 = (UV_AlarmAppDelegate *)[[UIApplication sharedApplication]delegate];
[self presentModalViewController:app7.frmComparisionChartLink animated:YES];
[app7 release];

still I m releasing the pointer but still my app gets terminated.I dont no what to do.

Please Help me Thanks a lot in advance

+4  A: 

You shouldn't release the app delegate. In short, unless you alloc, copy or retain an object you don't need to release it.

Stephen Darlington
+1  A: 

Apple's documentation shows modalPresentation done like this;

UIViewController *uiViewController = [[UIViewController alloc] initWithNibName:@"UIViewController" bundle:nil];
uiViewController.delegate = self;

UINavigationController *navigationController = [[UINavigationController alloc] initWithRootViewController:uiViewController];
[self presentModalViewController:navigationController animated:YES];
[navigationController release];
[uiViewController release];

Hopefully that helps.

Pudgeball