I get this error when I will send the text content in UITextField to my dictionary. But I can’t see what’s wrong in this code:
NSMutableDictionary *newDrink = [[NSMutableDictionary alloc]init];
[newDrink setValue:self.nameTextField.text forKey:NAME_KEY]; // error here
What can be?
I bet
self.nameTextFieldis nil.Check that.
Also, when attempting to access superclass member variables or properties from a subclass, make sure to create an instance variable (in your case, named
nameTextField) in the superclass and see if that solves your problem. As this iPhoneSDK.com thread says, “this is a very specific issue that crops up when you synthesize a property without creating an instance variable.”