I found an answer to this a while ago, and made a mental note to fix it, but now I can’t for the life of me find the post again.
Very simple – my current method for adding dictionaries to an array is leaky. Please, what is the best way to ensure they are being released properly? My method:
[beachPresenters addObject:[[NSMutableDictionary alloc]initWithObjectsAndKeys:
@"Kayak rides",@"name",@"kayak_sm.png",@"smPhoto",@"kayak_med",@"medPhoto",@"Free kayak rides for kids",@"description",@"",@"Friday",
@"All day! 10.00am - 6.00pm",@"Saturday",@"",@"Sun",@"Beach",@"stage",@"Blah blah blah",@"blurb",nil]];
beachPresenters(I assume it’s an array) takes ownership of the dictionary, so the +1 to the reference count caused by+alloc/-initof the dictionary is not balanced. Thus, the dictionary is leaked.Use the convenience method equivalent to balance the retain: