I have a few dates and strings that are declared as nonatomic and retained.
When I set the date or change the string using self.string it isn’t being retained. If I force it by [string retain] I have no issues, although this creates memory leaks.
Any ideas or how or what I’m doing wrong?
Cheers
Update:
@property (nonatomic, retain)NSDate *time;
self.time = [cal dateFromComponents:comps];
self.time doesn’t retain. I have to [time retain];
You are either releasing the string twice or accessing it after it has already been released. If you post some code, it will help determine what’s going on if that’s not enough to go by.