Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Why won't this work!?



On 24/10/2007, at 11:39 PM, Mike Schrag wrote:

I've notice one thing with NSDictionary:
 you can call directly the key of the element to get the value:

dict = {key1 = "MyValue1", key2 = "MyValue2"}

str : WOString {
   value = dict.key1;
}

and result is MyValue1.

is this how dictionaries work?
Yes -- same deal ... except for allKeys, allValues, and count.

Not quite. If you happen to have the following: NSMutableDictionary dict = new NSMutableDictionary(); dict.setObjectForKey( new Integer( 45 ), "count" );

value = dict.count --> 45.

whereas:
dict.removeAllObjects();
dict.setObjectForKey( new Integer( 45 ), "howdy" );

value = dict.count --> 1.

with regards,
--

Lachlan Deck
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Webobjects-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/webobjects-dev/email@hidden

This email sent to email@hidden
References: 
 >Why won't this work!? (From: Miguel Arroz <email@hidden>)
 >Re: Why won't this work!? (From: Mike Schrag <email@hidden>)
 >Re: Why won't this work!? (From: "Daniele Corti" <email@hidden>)
 >Re: Why won't this work!? (From: Mike Schrag <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.