[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Problems with Replacing a String is a NSMutableString
From: |
Charles philip Chan |
Subject: |
Problems with Replacing a String is a NSMutableString |
Date: |
Wed, 23 Jul 2008 19:53:36 -0400 |
User-agent: |
Gnus/5.110011 (No Gnus v0.11) Emacs/23.0.60 (gnu/linux) |
Hello:
I am currently having a problem with replacing a string in an
NSMutableString and I am not too sure whether it is a bug in the current
SVN tree or I am doing something stupid. Here are the code snippets:
...
NSMutableString *albumIndexTemp;
...
// PlayItem is just a dictionary of strings. Since there is
// only 1 key with the value of "Album". The first index of
// the array should return something like
// "ID_CLIP_INFO_NAME4".
albumIndexTemp = [[playingItem allKeysForObject:@"Album"]
objectAtIndex: 0];
// This should return something like "ID_CLIP_INFO_VALUE4"
[albumIndexTemp replaceOccurrencesOfString:@"NAME"
withString:@"VALUE"];
[albumBox setStringValue:[playingItem objectForKey:albumIndexTemp]];
[albumBoxMini setStringValue:[playingItem objectForKey:albumIndexTemp]];
----------------------------------------------------------------------
However, this doesn't seem to work. I have a similiar stanza above
(without the string replacement) and it worked:
if ([[playingItem objectForKey:@"ID_CLIP_INFO_NAME1"]
isEqual:@"Artist"]) {
[artistBox setStringValue:[playingItem
objectForKey:@"ID_CLIP_INFO_VALUE1"]];
[artistBoxMini setStringValue:[playingItem
objectForKey:@"ID_CLIP_INFO_VALUE1"
}
---------------------------------------------------
What am I doing wrong?
Thanks.
Charles
pgppd8QBpGFGu.pgp
Description: PGP signature
- Problems with Replacing a String is a NSMutableString,
Charles philip Chan <=