• 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
Problem with NSMutableDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem with NSMutableDictionary


  • Subject: Problem with NSMutableDictionary
  • From: Francis Derive <email@hidden>
  • Date: Sat, 18 Aug 2007 20:57:10 +0200


Dear all,

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];
[activeAppsLanguageStrings setObject:@"test" forKey:@"FDE"];


- Then, in an action of this same window controller : let's gdb speaks by itself


	(gdb) p activeAppsLanguageStrings
	$1 = (class NSMutableDictionary *) 0x389da0

	=> So, the variable is "recognized"

	(gdb) p (NSString *)[activeAppsLanguageStrings objectForKey:@"FDE"]
	Cannot access memory at address 0xfc4540f

	=> So, nothing good

At run time, the app crashes.
So, as I see it, the initialized NSMutableDictionary can't be read for its keys.
And the setting of a key


How that can be ?

Thanks very much for helping.

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: Andrew Farmer <email@hidden>
  • Prev by Date: Re: Strange _originalSnapshot error
  • Next by Date: Re: Problem with NSMutableDictionary
  • Previous by thread: Re: textStorage readFromURL does not like blanks
  • Next by thread: Re: Problem with NSMutableDictionary
  • Index(es):
    • Date
    • Thread