• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Problem with NSMutableDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem with NSMutableDictionary


  • Subject: Re: Problem with NSMutableDictionary
  • From: Francis Derive <email@hidden>
  • Date: Sat, 18 Aug 2007 22:12:30 +0200


On Aug 18, 2007, at 10:02 PM, Andrew Farmer wrote:

On 18 Aug 07, at 11:57, Francis Derive wrote:
It is a cocoa app.

- An action of the app delegate is to
- initialize a window controller : dsUserMainMenuWindowCtrl = [[DSMainMenuWindowController allocWithZone:[self zone]] initForUserLand:@"fr"
- show the window controller's window
- The init implementation of the window controller
- loads its nib
- initializes its NSMutableDictionary *instance variable :


NSMutableDictionary *activeAppsLanguageStrings = [NSMutableDictionary dictionaryWithCapacity:1];

[NSMutableDictionary dictionaryWithCapacity:] returns an autoreleased dictionary (read the Cocoa memory management rules for an explanation of why this happens). As you don't appear to be explicitly retaining it in your code, it's getting released.

Andrew,

Short answer : many thanks.
Longer answer : I hate to be caught to this penalty.
Doc onto dictionaryWithCapacity should remind this which otherwise might be in the Cocoa Memory management rules to be revisited. Apps runs.


Cheers,

Francis
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Problem with NSMutableDictionary
      • From: mmalc crawford <email@hidden>
    • Re: Problem with NSMutableDictionary
      • From: Todd Blanchard <email@hidden>
References: 
 >Problem with NSMutableDictionary (From: Francis Derive <email@hidden>)
 >Re: Problem with NSMutableDictionary (From: Andrew Farmer <email@hidden>)

  • Prev by Date: Re: Problem with NSMutableDictionary
  • Next by Date: Re: Problem with NSMutableDictionary
  • Previous by thread: Re: Problem with NSMutableDictionary
  • Next by thread: Re: Problem with NSMutableDictionary
  • Index(es):
    • Date
    • Thread