Re: Storing objects in NSMutableDictionary
Re: Storing objects in NSMutableDictionary
- Subject: Re: Storing objects in NSMutableDictionary
- From: Kyle Sluder <email@hidden>
- Date: Fri, 13 Aug 2010 13:15:45 -0700
On Fri, Aug 13, 2010 at 1:09 PM, Geoffrey Holden
<email@hidden> wrote:
> Is it possible to store a class object in NSMutableDictionary? I want to do something like the following - but it doesn't seem to work!
>
> NewMessage* message = [[NewMessage alloc] initWithApp:@"Messenger" :self]; //initWithApp passes in the nib name and a reference to itself (wonder where I got that clever idea from!)
Really, this method is called -initWithApp::?
> [currentMessages setObject:message forKey:messageID];
>
>
> Trouble is, this doesn't seem to work - currentMessages (an NSMutableDictionary) seems to be able to store anything except a class object.
What "doesn't work" about it? Not to mention no class objects are
involved here, just an instance of NSDictionary, an instance of
NewMessage, and whatever messageID is.
--Kyle Sluder
_______________________________________________
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