objective c - iPhone simulator crashes because of GDP error, also has warning: -


warning: 'rootviewcontroller' may not respond '-peformselector:withobject:afterdelay:'

crash in debugger console:

    {[session started @   2011-04-30 21:57:58 +0800.]  2011-04-30 21:57:59.414 gravity man[57133:207] -[rootviewcontroller peformselector:withobject:afterdelay:]: unrecognized selector sent instance 0x4e0d740  2011-04-30 21:57:59.417 gravity man[57133:207] * terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[rootviewcontroller peformselector:withobject:afterdelay:]: unrecognized selector sent instance 0x4e0d740' *  call stack @ first throw: (      0 corefoundation 0x00f0cbe9     exceptionpreprocess + 185      1 libobjc.a.dylib 0x010615c2    objc_exception_throw + 47      2 corefoundation 0x00f0e6fb     -[nsobject(nsobject) doesnotrecognizeselector:] + 187      3 corefoundation 0x00e7e366     __forwarding + 966      4 corefoundation 0x00e7df22     _cf_forwarding_prep_0 + 50      5 gravity man 0x00002c8d    -[rootviewcontroller viewwillappear:] + 471      6 uikit 0x00374c9a      -[uinavigationcontroller _starttransition:fromviewcontroller:toviewcontroller:] + 858      7 uikit 0x0036f606      -[uinavigationcontroller _startdeferredtransitionifneeded] + 266      8 uikit 0x00487e01      -[uilayoutcontainerview layoutsubviews] + 226      9 quartzcore 0x00cab451     -[calayer layoutsublayers] + 181      10 quartzcore 0x00cab17c    calayerlayoutifneeded + 220      11 quartzcore 0x00ca437c    _zn2ca7context18commit_transactionepns_11transactione + 310      12 quartzcore 0x00ca40d0    _zn2ca11transaction6commitev + 292      13 uikit 0x002bb19f         -[uiapplication _reportapplaunchfinished] + 39      14 uikit 0x002bb659         -[uiapplication _runwithurl:payload:launchorientation:statusbarstyle:statusbarhidden:] + 690      15 uikit 0x002c5db2         -[uiapplication handleevent:withnewevent:] + 1533      16 uikit 0x002be202         -[uiapplication sendevent:] + 71      17 uikit 0x002c3732         _uiapplicationhandleevent + 7576      18 graphicsservices         0x01842a36 purpleeventcallback + 1550      19 corefoundation 0x00eee064    cfrunloop_is_calling_out_to_a_source1_perform_function + 52      20 corefoundation 0x00e4e6f7    __cfrunloopdosource1 + 215      21 corefoundation 0x00e4b983    __cfrunlooprun + 979      22 corefoundation 0x00e4b240    cfrunlooprunspecific + 208      23 corefoundation 0x00e4b161    cfrunloopruninmode + 97      24 uikit 0x002bafa8         -[uiapplication _run] + 636 25 uikit 0x002c742e uiapplicationmain + 1160 26 gravity man 0x0000282a main + 84      27 gravity man 0x000027cd   start + 53  ) terminate called after throwing instance of 'nsexception'  } 

.h:

{  @interface rootviewcontroller : uiviewcontroller {  iboutlet uilabel* label1; iboutlet uilabel* label2; iboutlet uilabel* label3; iboutlet uiimageview* image1; iboutlet uiimageview* image2; iboutlet uiimageview* image3; iboutlet uibutton* newgamebutton; iboutlet uibutton* facebookbutton; iboutlet uibutton* settingsbutton;  cakeyframeanimation* popanimation; }  -(ibaction)newgame:(id)sender;  @end  } 

.m:

@implementation rootviewcontroller  -(ibaction) newgame:(id)sender { gamescreen* pong = [[gamescreen alloc] initwithnibname:@"gamescreen" bundle:nil];  [self.navigationcontroller pushviewcontroller:pong animated:no]; } -(void)popview:(uiview*)view { [view sethidden:no]; [[view layer] addanimation:popanimation forkey:@"transform.scale"]; } - (void)viewdidload {      popanimation = [cakeyframeanimation animationwithkeypath:@"transform.scale"];     popanimation.keytimes = [nsarray arraywithobjects: [nsnumber numberwithfloat:0.0], [nsnumber numberwithfloat:0.7], [nsnumber numberwithfloat:1.0], nil];     popanimation.values = [nsarray arraywithobjects: [nsnumber numberwithfloat:0.01], [nsnumber numberwithfloat:1.1], [nsnumber numberwithfloat:1.0], nil];     [popanimation retain];      [super viewdidload];    }    -(void)viewwillappear:(bool)animated {  [popanimation setduration:0.9]; [label1 sethidden:yes]; [label2 sethidden:yes]; [label3 sethidden:yes]; [newgamebutton sethidden:yes]; [facebookbutton sethidden:yes]; [settingsbutton sethidden:yes]; [self performselector:@selector(popview:) withobject:label1 afterdelay:0.9]; [self performselector:@selector(popview:) withobject:label2 afterdelay:0.95]; [self performselector:@selector(popview:) withobject:label3 afterdelay:1];     //"warning shows among these lines"//  [self performselector:@selector(popview:) withobject:newgamebutton afterdelay:0.9];  [self peformselector:@selector(popview:) withobject:settingsbutton afterdelay:0.95];  [self performselector:@selector(popview:) withobject:facebookbutton afterdelay:1];      [super viewwillappear:animated];     }   @end  } 

thank , please help!

change

[self peformselector:@selector(popview:) withobject:settingsbutton afterdelay:0.95];`        ^^ 

into

[self performselector:@selector(popview:) withobject:settingsbutton afterdelay:0.95];`        ^^^ 

ie add r between pe , formselector


Comments