discuss-gnustep
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problems with Replacing a String is a NSMutableString


From: Charles philip Chan
Subject: Re: Problems with Replacing a String is a NSMutableString
Date: Thu, 24 Jul 2008 04:20:08 -0400
User-agent: Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux)

David Ayers <ayers@fsfe.org> writes:

Hello David:

> I would assume that if playingItem is an NS[(Mutable)Dictionary that the
> key returned by allKeysForObject: are immutable.  Keys for collections
> are copied by the collection to insure they are immutable.  Allowing
> them to be mutable would break the internal hash lookups.

I still don't understand this, the method "allKeysForObject" is supposed
to:

,----
| Returns an array containing all the dictionary's keys that are
| associated with anObject.[1]
`----

So basically I am returning an array of the keys, and since there is
only 1 key for the object "Album" I search for it at index zero in the
array and return it as an NSMutableString. I then want to change the
string to the really key for the "Album" title and search the dictionary
for the object- I am not even touching the dictionary. Also
"playingItem" is defined as mutable:

,----
| NSMutableDictionary *playingItem = myPlayingItem;
`----

Thanks for your reply.

Charles

---
[1] From 
http://www.gnustep.org/resources/documentation/Developer/Base/Reference/NSDictionary.html#method$NSDictionary-allKeysForObject$

Attachment: pgpWO0B9bwmyB.pgp
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]