iphone - iOS App Exception - Terminating app due to uncaught exception 'NSInvalidArgumentException' -
i getting following exception, terminating app.
terminating app due uncaught exception 'nsinvalidargumentexception', reason: '-[__nsarraym objectforkey:]: unrecognized selector sent instance 0x7abe4f90'
following code:
- (nsmutabledata*)dataforconnection:(urlconnection*)connection { nsmutabledata *data = [receiveddata objectforkey:connection.tagkey]; // exception here return data; }
could please suggest how fix it? thank in advance!
problem due not allocating receiveddata properly, since have declared instance variable, should make using property declaration this:
@property(nonatomic, strong) nsmutabledictionary *receiveddata;
this ensure receiveddata not released , reference using self.receiveddata in code. maybe helpful
Comments
Post a Comment