Re: proper way to release a static NSMutableDictionary?

2008-12-18 Thread Dale Merrick
As someone else suggested why not just use [lookup removeAllObjects] or perhaps I am missing a part of the bigger picture for the project you're working on. Dale Merrick On Dec 15, 2008, at 4:54 PM, John Michael Zorko wrote: Hello, all ... Imagine this: static NSMutableDictionary

Re: proper way to release a static NSMutableDictionary?

2008-12-16 Thread Jean-Daniel Dupas
Le 16 déc. 08 à 05:56, Andy Lee a écrit : On Dec 15, 2008, at 6:27 PM, John Michael Zorko wrote: I'm not concerned about the contents per se -- i'm concerned about releasing something I declared as static, just to create it again later. Creating and re-creating objects is in itself

proper way to release a static NSMutableDictionary?

2008-12-15 Thread John Michael Zorko
Hello, all ... Imagine this: static NSMutableDictionary *lookup = [NSMutableDictionary new]; ... now imagine a situation where I need to clear that dictionary. If I call [lookup release]; lookup = [NSMutableDictionary new]; ... it will obviously be faster than coding a for loop and

Re: proper way to release a static NSMutableDictionary?

2008-12-15 Thread Randall Meadows
On Dec 15, 2008, at 3:54 PM, John Michael Zorko wrote: Hello, all ... Imagine this: static NSMutableDictionary *lookup = [NSMutableDictionary new]; ... now imagine a situation where I need to clear that dictionary. [lookup removeAllObjects]; is probably your best choice. If I call

Re: proper way to release a static NSMutableDictionary?

2008-12-15 Thread Ashley Clark
On Dec 15, 2008, at 4:54 PM, John Michael Zorko wrote: Hello, all ... Imagine this: static NSMutableDictionary *lookup = [NSMutableDictionary new]; ... now imagine a situation where I need to clear that dictionary. If I call [lookup release]; lookup = [NSMutableDictionary new]; ... it

Re: proper way to release a static NSMutableDictionary?

2008-12-15 Thread Charles Steinman
- Original Message From: John Michael Zorko jmzo...@mac.com To: cocoa-dev@lists.apple.com Sent: Monday, December 15, 2008 2:54:46 PM Subject: proper way to release a static NSMutableDictionary? Hello, all ... Imagine this: static NSMutableDictionary *lookup

Re: proper way to release a static NSMutableDictionary?

2008-12-15 Thread John Michael Zorko
Ashley, Imagine this: static NSMutableDictionary *lookup = [NSMutableDictionary new]; ... now imagine a situation where I need to clear that dictionary. If I call [lookup release]; lookup = [NSMutableDictionary new]; ... it will obviously be faster than coding a for loop and removing

Re: proper way to release a static NSMutableDictionary?

2008-12-15 Thread Andrew Farmer
On 15 Dec 08, at 14:54, John Michael Zorko wrote: Imagine this: static NSMutableDictionary *lookup = [NSMutableDictionary new]; ... now imagine a situation where I need to clear that dictionary. If I call [lookup release]; lookup = [NSMutableDictionary new]; ... it will obviously be

Re: proper way to release a static NSMutableDictionary?

2008-12-15 Thread Graham Cox
On 16 Dec 2008, at 10:27 am, John Michael Zorko wrote: I'm not concerned about the contents per se -- i'm concerned about releasing something I declared as static, just to create it again later. Part of me is saying just release the dictionary's contents, not the dictionary itself.

Re: proper way to release a static NSMutableDictionary?

2008-12-15 Thread Ken Thomases
On Dec 15, 2008, at 5:33 PM, Andrew Farmer wrote: On 15 Dec 08, at 14:54, John Michael Zorko wrote: Imagine this: static NSMutableDictionary *lookup = [NSMutableDictionary new]; ... now imagine a situation where I need to clear that dictionary. If I call [lookup release]; lookup =

Re: proper way to release a static NSMutableDictionary?

2008-12-15 Thread Michael Ash
On Mon, Dec 15, 2008 at 5:54 PM, John Michael Zorko jmzo...@mac.com wrote: Hello, all ... Imagine this: static NSMutableDictionary *lookup = [NSMutableDictionary new]; ... now imagine a situation where I need to clear that dictionary. If I call [lookup release]; lookup =

Re: proper way to release a static NSMutableDictionary?

2008-12-15 Thread Andy Lee
On Dec 15, 2008, at 6:27 PM, John Michael Zorko wrote: I'm not concerned about the contents per se -- i'm concerned about releasing something I declared as static, just to create it again later. Creating and re-creating objects is in itself nothing to be afraid of. It happens all the