I have one controller inheriting UITableViewController, and call the object as below
editAlarm *ob = [[editAlarm alloc] initWithStyle:UITableViewStyleGrouped];
UINavigationController *nc = [[UINavigationController alloc] initWithRootViewController:ob];
ob.modalTransitionStyle = UIModalTransitionStyleFlipHorizontal;
[self presentModalViewController:nc animated:YES];
[ob release];
ob = nil;
[nc release];
nc = nil;
now the table will initialized with groupstyle, but I want an object with it my data as normally I do in many of my projects
-(id)initwithData:(myFaceData *)dat{
id i=[super init];
self.data=dat; where data is object having some variables in it
return i;
}
myFaceData *data=[myArray objectAtIndex:tag];
editAlarm *ob = [[editAlarm alloc] initwithData:data];
[self.navigationController pushViewController:details animated:NO];
Now How can I do two init at same time, what is solution so that my object will pass along with init of new class(Controller)
If someone is not clear about question, then feel free to ask in comments
Thanks in Advance 🙂
What you could do is make your data variable a Property (and synthesise it) so you can set it right after you init it in the class you are initialising it.
Alternatively you could create your own init method as follows:
And to call your initialiser you could do this in the calling class (where
theDatais the data to be passed across):