objective c - Crash upon getting data from NSUserDefaults -
getting data nsuserdefaults , passing has parameter application crashed
nsuserdefaults *prefs = [nsuserdefaults standarduserdefaults]; [logincontroller showview:[prefs objectforkey:ksavedusername] :[prefs objectforkey:ksaveduserpassword]]; // [logincontroller showview:@"abcd03@gmail.com" password:@"apple”];
when printing value in nslog [prefs objectforkey:ksaveduserpassword]
showing value. password , [prefs objectforkey:ksavedusername]
user name.
if hard-coded requirement parameters working fine.
my crash log is
unrecognized selector sent instance 0x5ccc2d0 2011-07-21 14:32:27.721 ishop[3815:207] *** terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[loginviewcontroller showview::]: unrecognized selector sent instance 0x5ccc2d0' *** call stack @ first throw:
your logincontroller
doesn't respond showview::
message, that's why app crashes. check method name in loginviewcontroller
, , correct it. think there no matter nsuserdefaults
.
try avoid unamed parameters in selectors, always name them, avoid problems.
Comments
Post a Comment