• 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: [Newbie] Good NSDictionary example?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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.

  • Follow-Ups:
    • Re: [Newbie] Good NSDictionary example?
      • From: Andreas Mayer <email@hidden>
  • Prev by Date: Re: NEWBIE: NSArray toll-free-bridged with CFArray?
  • Next by Date: Re: NEWBIE: NSArray toll-free-bridged with CFArray?
  • Previous by thread: Re: [Newbie] Good NSDictionary example?
  • Next by thread: Re: [Newbie] Good NSDictionary example?
  • Index(es):
    • Date
    • Thread