objective c - program crashes when trying to present modal view controller -


i want load xib, , use simple code:

addelementviewcontroller *viewtoload = [[addelementviewcontroller alloc] initwithnibname:@"addelementviewcontroller" bundle:nil]; viewtoload.modaltransitionstyle = uimodaltransitionstylecoververtical; [self presentmodalviewcontroller:viewtoload animated:yes]; 

for reason throws me out output:

2012-03-11 11:56:57.990 weesh[14650:11603] -[mainviewcontroller addpressed:]:     unrecognized selector sent instance 0x7b55b40 2012-03-11 11:56:57.991 weesh[14650:11603] *** terminating app due uncaught exception     'nsinvalidargumentexception', reason: '-[mainviewcontroller addpressed:]: unrecognized     selector sent instance 0x7b55b40' *** first throw call stack: (0x13da052 0x198ed0a 0x13dbced 0x1340f00 0x1340ce2 0x13dbec9 0x32a5c2 0x32a55a 0x3cfb76     0x3d003f 0x3cf2fe 0x34fa30 0x34fc56 0x336384 0x329aa9 0x22c7fa9 0x13ae1c5 0x1313022     0x131190a 0x1310db4 0x1310ccb 0x22c6879 0x22c693e 0x327a9b 0x1cad 0x1c15) terminate called throwing exception(lldb)  

do have idea can cause it?

somewhere in code (it seems in addelementviewcontroller implementation) sending message addpressed: object of class mainviewcontroller.

the call stack , crash error says there no method addpressed: in class mainviewcontroller.

try find places calling addpressed: (first of check loadview, viewdidload, viewwillappear, viewdidappear, init of addelementviewcontroller class) , check type of receiver.


Comments

Popular posts from this blog

jasper reports - Fixed header in Excel using JasperReports -

media player - Android: mediaplayer went away with unhandled events -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -