Iphone 'NSInvalidArgumentException', reason: '-[__NSCFSet setPolicyNumber:]
Hi i am a newbie to iPHone development and I am getting this error that states that the setter method cannot be found for a string variable despite that variable being declared with the @property and @synthesize declarations. The variable is contained within a seperate object to the class which I am attempting to set the value. Any help would be appreciated.
here is the code relating to the error.
[reg setPolicyNumber:self.policyNoField.text];
[reg printSummaryToConsole];
debugger says that
-[__NSCFSet setPolicyNumber:]: unrecognized selector sent to instance 0x643fd80 * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSCFSet setPolicyNumber:]: unrecognized selector sent to instance 0x643fd80'
I have allocated an initialized the Registration class (reg) in this class and I have the PolicyNumber created and synthesized in the registration c开发者_Python百科lass also. yet I am still getting this error. Any help would be appreciated.
reg
is a reference to an instance of NSCFSet
.
Most likely, you failed to retain whatever reg
was supposed to refer to in the first place and, coincidentally, an NSCFSet happened to be allocated where the old object was.
Use Build and Analyze, then use zombie detection if that doesn't identify the problem.
精彩评论