Reputation: 31
Can i call a class variable "id" (for example NSString *id)? Everything seems to work, except that i cannot make [id release] in dealloc method. I'm creating instances of this class from a XML parser using object/key construct so i need this to be called id. I've tried [self.id release] and everthing works, except that the analyzer shows me a warning saying "Property returns an Objective-C object with a +0 retain count" and "Incorrect decrement of the reference count of an object that is not owned at this point by the caller". So i'm wondering if i'm doing something illegal. Thank you very much.
Upvotes: 1
Views: 3216
Reputation: 119242
Don't do it.
Upvotes: 1
Reputation: 32066
id
is a keyword in objective-c. It's a weak type variable identifier, similar to var
in javascript.
Upvotes: 2
Reputation: 17732
id
in objective-c is a predefined type. You should probably name it something different, like idString
It is the same thing as attempting to name a variable int
or another objective-c keyword like if
Upvotes: 3