I have an issue with NSMutablestring. When i use it without override my class init method it doesn't work.
my interface code:
@interface Topic : NSObject
@property (strong, nonatomic) NSMutableString *title;
@property (strong, nonatomic) NSMutableString *description;
@end
If I created an object with this class then tried to assign a string to the "title", its NSLog prints Null!
This is my code when I'm trying to use it:
Topic *myTopic = [[Topic alloc] init];
[myTopic.title appendString:@"Hello World"];
To avoid this problem I have to override my Topic class init method and add this line:
self.title = [[NSMutableString alloc]init];
Any idea?
EDIT: this line should initialize my properties and methods right (without overriding the init method)?
Topic *myTopic = [[Topic alloc] init];
Thanks,