Replacing values in NSDictionary
Replacing values in NSDictionary
- Subject: Replacing values in NSDictionary
- From: Carl Johan Foss <email@hidden>
- Date: Sun, 7 Jan 2007 10:22:04 +0100
Hi,
I have an NSMutableArray containing NSDictionary objects in
"lFullResult", Now I would like to replace a value for the key "id"
whenever num = st.
How can I do that? the [lFullResult replaceValueAtIndex:0
inPropertyWithKey:@"id" withValue:vx]; does not seem to work, or I do
not know how to use it?
Any help is highly appreciated and hope I am clear with my quesion
Thanks
Carl
-(void)refreshLec:(NSNumber *)num
{
NSEnumerator *e = [lFullResult objectEnumerator];
id item;
while (item = [e nextObject]) {
NSNumber *st = [item valueForKey:@"id"];
if(![st isNSNull]) {
if([st isEqualToNumber:num]) {
MCPNumber *vx = [MCPNumber numberWithInt:1];
[lFullResult replaceValueAtIndex:0 inPropertyWithKey:@"id"
withValue:vx];
[lectureTable reloadData];
NSLog(@"Value = %@ and Key %@", st, item );
}
else {
//NSLog(@"No match!");
}
}
}
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden