• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Replacing values in NSDictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: Replacing values in NSDictionary
      • From: James Bucanek <email@hidden>
    • Re: Replacing values in NSDictionary
      • From: Sean Murphy <email@hidden>
  • Prev by Date: Integrate CM into Cocoa
  • Next by Date: Re: NSPopupButton with NSArrayController
  • Previous by thread: Integrate CM into Cocoa
  • Next by thread: Re: Replacing values in NSDictionary
  • Index(es):
    • Date
    • Thread