I have a question about how instance variables work and when to use the @property. Here is an example interface file I am working with
@interface PackageModel : NSObject {
NSString *tracking;
NSString *carrier;
NSString *status;
NSMutableDictionary *events;
// Connection ivars
NSMutableData *receivedData;
// Parsing ivars
int tagLevel;
NSMutableArray *tagTree;
NSString *parentTag;
NSString *currentTag;
}
@property (nonatomic, retain) NSMutableData *receivedData;
- (id)initWithTrackingString:(NSString *)string;
- (void)getPackageDataWithEvents;
- (void)printMe;
@end
How can I access these in the file's code. Can I access tracking, carrier, and status in this class's methods just by using something like
tracking = [[NSString alloc] initWithString:@"Hello World"];
Also, what variables need to be put in the dealloc? Only the variables I have in the @property/@synthesize? Or do I need to release all the instance variables in the dealloc method.
I am just looking for some clarification on how instance variables work in Objective-C. Thanks.