I thought I understand this topic, but now I got confuse. I have some classes as below, I am not sure if I have to provide a init method, I want to know when I have to have a init when not:
Code:
@interface MarketEvent : NSObject {
int day;
NSString *title;
}
@property (nonatomic, assin) int day;
@property (nonatomic, retain) title;
@end
@inplementation MarketEvent
@synthesize year;
@synthesize title;
-(void)dealloc {
[title release];
[super dealloc];
}
@end
Code:
@interface MrketEvents : NSObject {
NSArray *events;
}
@property (nonatomic, retain) NSArray *events;
@end
@inplementation MarketEvents
@synthesize events;
-(void)dealloc {
[events release];
[super dealloc];
}
@end
Last edited: