Best way to call other class view in iphone?
- by aman-gupta
Hi,
Generally i call my other class view by creating a pointer of delegate and then call the other class by using its link as below:-
First Way :-
Mydelegate *ptr = (Mydelegate *)[[UIApplication sharedApplication]delegate];
[self.navigationController pushViewController:ptr.NextClasspointer animated:YES];
Second Way :-
Create a pointer of that class which u want to call :--
NextClass *nextptr = [[NextClass alloc]initWithnibName:@"NextClass" bundle:nil];
[self.navigationController pushViewController:nextptr animated:YES];
[nextptr release];
nextptr = nil;
These above two methods i generally used but my problem is that which one is best for big project so that my stack problem will be removed I mean memory issue will be solved.And
is it necessary to release pointer in first and second case is the way i release is correct or wrong
Please help me
Thanks in Advance