Suppose I have this code...
foo.h
@interface Foo : NSObject {
NSString *aString; // 1
}
@property (nonatomic, retain) NSString *aString;
foo.m
@synthesize aString = _aString;
....
- (void)dealloc {
[aString release];
[super dealloc];
}
My questions are:
- do I really need to declare aString in "1"? (see code)
- if I am synthesizing aString = _aString, I am already creating an instance variable, right?
- if I am retaining the property on foo.h (@property), why Xcode complains if I release aString in dealloc?
thanks.