Re: [Newbie] Good NSDictionary example?
Re: [Newbie] Good NSDictionary example?
- Subject: Re: [Newbie] Good NSDictionary example?
- From: ber <email@hidden>
- Date: Sat, 7 Sep 2002 18:48:33 -0400
Here's some very basic stuff in case it's what you're looking for.
I'm pretty new to this as well so forgive me if I underestimated your
needs.
NSMutableDictionary *myDictionary = [[ NSMutableDictionary alloc]
init];
[ myDictionary setObject:@"Keith" forKey:@"name"];
[ myDictionary setObject:@"hacker" forKey:@"subject"];
[ myDictionary setObject:@"4/9/2002" forKey:@"date"];
NSEnumerator *enumerator = [ myDictionary keyEnumerator];
NSString *key;
while (key = [ enumerator nextObject]) {
printf("%s\n", [[ myDictionary objectForKey:key] UTF8String]);
}
And yes, an NSArray of these sounds like it would be fine.
brian redman
On Saturday, September 7, 2002, at 06:11 PM, Keith Pritchard wrote:
>
Hi all,
>
>
After an afternoon of "attempt to insert nil value" and SIGTRAPs, is
>
there a simple example of creating an NSDictionary somewhere?
>
>
I want something like :-
>
>
string -> string
>
string
>
date
>
>
looking like
>
>
myreference -> name
>
subject
>
date
>
>
(about 35,000 of these records)
>
>
Want to be able to say, for myreference="something" show me name,
>
subject,date ... the results of which end up in a table.
>
>
Is this best represented as an array of dictionaries somehow?
>
>
Thanks in advance,
>
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.
_______________________________________________
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.