Problem with NSMutableDictionary
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