• 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: NSDictionary entry with key from NSArray
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSDictionary entry with key from NSArray


  • Subject: Re: NSDictionary entry with key from NSArray
  • From: Michael Becker <email@hidden>
  • Date: Wed, 23 Feb 2005 13:10:01 +0100

Am 23.02.2005 um 12:28 schrieb René Korthaus:
<code>
NSDictionary * tracksDict = [NSDictionary dictionaryWithDictionary:[musicLibrary objectForKey:@"Tracks"]];
NSMutableArray * tmpArray = [NSMutableArray array];
int ii = 0;
while (ii < [playlistIDsArray count]) {
trackDictionary = [tracksDict objectForKey:[playlistIDsArray objectAtIndex:ii]];
NSLog(@"track: %@\n", [playlistIDsArray objectAtIndex:ii]);
[tmpArray addObject:trackDictionary];
ii++;
}
</code>


However this wont work. The Run Log keeps saying "attempt to insert nil". But when I try nslog as above, it tells me the number.

Try replacing your NSLog call with this:

	NSLog(@"track: %@\n", trackDictionary);

Most obviously, trackDictionary is nil. So you might want to check your tracksDict dictionary, especially the way you saved the key-value-pairs.

Regards,
Michael

_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSDictionary entry with key from NSArray (From: RenĂ© Korthaus <email@hidden>)

  • Prev by Date: Re: Cocoa equivalent of AppleScript "choose folder"
  • Next by Date: Re: Re: Cocoa equivalent of AppleScript "choose folder" SOLVED
  • Previous by thread: Re: NSDictionary entry with key from NSArray
  • Next by thread: Re: Re: Cocoa equivalent of AppleScript "choose folder" SOLVED
  • Index(es):
    • Date
    • Thread