Re: [Newbie] Good NSDictionary example?
Re: [Newbie] Good NSDictionary example?
- Subject: Re: [Newbie] Good NSDictionary example?
- From: Keith Pritchard <email@hidden>
- Date: Sun, 8 Sep 2002 05:11:57 +0100
Thanks everyone for that great help! Really appreciated....
I've tried both ways... dictionary of arrays and as below, a dictionary
of dictionaries.
id myDict=[NSMutableDictionary dictionaryWithObjectsAndKeys:
[NSMutableDictionary
dictionaryWithObjectsAndKeys:@"keith",@"name",@"subject1",@"subject",@"1
2/12/02",@"date",nil],@"123",
[NSMutableDictionary
dictionaryWithObjectsAndKeys:@"helen",@"name",@"subject2",@"subject",@"1
3/12/03",@"date",nil],@"124",
nil];
I've added more data by doing:-
[myDict setObject:
[NSMutableDictionary
dictionaryWithObjectsAndKeys:@"asd",@"name",@"subject3",@"subject",@"14/
12/04",@"date",nil] forKey:@"125"];
Andreas mentioned retaining it to keep it around? I tried [myDict
retain] but ok, I suppose that was a bit optimistic :-)
When I try to access it in different methods the values come back as
null, so I guess it's only living in the function it's created in...
How can I make it accessible to the whole controller?
Thanks again for all the help,
Keith
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.