• 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
Re: Problem using dictionary
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Problem using dictionary


  • Subject: Re: Problem using dictionary
  • From: Remco Poelstra <email@hidden>
  • Date: Fri, 8 Oct 2010 13:47:18 +0200

Ah, I should use valueForKeyPath:. Is there a reason valueForKey: is documented directly but valueForKeyPath: is not?

Kind regards,

Remco Poelstra

Op 8 okt 2010, om 13:34 heeft Remco Poelstra het volgende geschreven:

> Hi,
>
> I've the following code:
>
> NSDictionary *dict=[[NSDictionary alloc] initWithContentsOfFile:[[NSBundle mainBundle] pathForResource:@"Indexes" ofType:@"plist"]]; //This is actually a global initialized in +initialize.
> NSString *key=[NSString stringWithFormat:@"%@.%@",page,property];
> NSLog(@"%@",key);
> NSLog(@"%@",[[dict valueForKey:key] description]);
> NSLog(@"%@",[[[dict valueForKey:page] valueForKey:property] 	description]);
>
> The result from the code is:
>
> page1.fwRevCode
> (null)
> 6
>
> The first and last are exactly what I expect. But why can't the dictionary find the value with the full key?
>
> Thanks in advance.
>
> Regards,
>
> Remco Poelstra_______________________________________________
>
> Cocoa-dev mailing list (email@hidden)
>
> Please 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

_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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: Problem using dictionary
      • From: Quincey Morris <email@hidden>
References: 
 >Problem using dictionary (From: Remco Poelstra <email@hidden>)

  • Prev by Date: Problem using dictionary
  • Next by Date: Where is SimpleTextInput sample code project?
  • Previous by thread: Problem using dictionary
  • Next by thread: Re: Problem using dictionary
  • Index(es):
    • Date
    • Thread