I’m new to obj-c and I’m trying to code a simple “inputs to plist” app. I have two inputs:
@property (strong, nonatomic) IBOutlet UITextField *costo;
@property (strong, nonatomic) IBOutlet UITextField *descrizione;
and I synthesize them in the .m file
@synthesize costo;
@synthesize descrizione;
then I have a function saveData() with:
NSNumber *newValue = [NSNumber numberWithInt:[costo.text intValue]];
[mutableDictCopy setObject:newValue forKey:[descrizione.text]];
this function works fine with costo.text, but then I get an “Expected identifier” error with descrizione.text. if I switch it with @”foo”, all goes fine and it updates my plist. Where do I get wrong?
You are mixing the member and message syntaxes. This is OK:
The following is also OK. It means the same thing.
This is not OK: