iphone - using a viewController to open another instance of the same viewController -


i have masterviewcontroller.h.m.xib (uiviewcontroller) opening testdummy.h.m.xib (uiviewcontroller) in following way:

testdummy *controller = [[testdummy alloc] initwithnibname:@"testdummy" bundle:nil]; [scrollview addsubview:controller.view]; 

i have 2 buttons in testdummy: (open), (close) , 1 label: (windowdepth).

i'm trying create second instance testdummy open first testdummy. allow multiple testdummy (uiviewcontroller) open n depth , allow close button take them 0 depth. here's have open button.

-(ibaction) btnopen_clicked{ testdummy *newcontroller = [[testdummy alloc] initwithnibname:@"testdummy" bundle:nil]; newcontroller.isnotroot = yes; newcontroller.windowdepth = self.windowdepth + 1; //do stuff... childdummy = newcontroller;  // start animated transition [uiview beginanimations:@"page transition" context:nil]; [uiview setanimationduration:1.0]; [uiview setanimationtransition:uiviewanimationtransitioncurlup forview:self.view cache:yes];  //insert new subview [self.view addsubview:newcontroller.view];  // commit transition animation [uiview commitanimations]; [newcontroller release]; 

}

when error in debug console.

2010-10-07 00:59:12.549 orionclient[5821:207] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nscftype btnopen_clicked]: unrecognized selector sent instance 0x6a339a0' 

must memory management issue can't figure out.

thanks in advance.

'nsinvalidargumentexception', reason: '-[__nscftype btnopen_clicked]: unrecognized selector sent instance 0x6a339a0'

it means trying call non existing method on instance. how have defined btnopen_clicked selector? i'm guessing should more like, need see how defined selector.

-(ibaction) btnopen_clicked:(id)sender 

Comments

Popular posts from this blog

ASP.NET/SQL find the element ID and update database -

jquery - appear modal windows bottom -

c++ - Compiling static TagLib 1.6.3 libraries for Windows -