Still learning Objective-C / iPhone SDK here. I think I know why this wasn't working but I just wanted to confirm.
In awakeFromNib
, if I use [[NSMutableDictionary alloc] initWithObjects:...]
it actually allocates (iPhone) system memory with this NSMutableDictionary
data, but when I use [NSMutableDictionary dictionaryWithObjects:...]
it is only available in the stack right?
For example, in the future if I try to access myMutableDict
from a button press via IBAction, the myMutableDict
object may have been freed, causing my app to crash, even though I have defined it like so in my .h file, and synthesized it:
@property (nonatomic, retain) NSMutableDictionary *myMutableDict;
For some reason changing to [[NSMutableDictionary alloc] initWithObjects:...]
fixed this.