Skip to content

Instantly share code, notes, and snippets.

@fahim
Created February 20, 2013 17:36
Show Gist options
  • Save fahim/4997373 to your computer and use it in GitHub Desktop.
Save fahim/4997373 to your computer and use it in GitHub Desktop.
new obj-c syntax fail (or maybe im just using it wrong)
NSDictionary *songDict = @{@"artists": [item valueForProperty: MPMediaItemPropertyArtist],
@"title": [item valueForProperty: MPMediaItemPropertyTitle]};
// ----------- vs ---------- //
// the new syntax above caused a memory error. i ended up just using the old syntax below and the code worked fine
// ----------- vs ---------- //
NSDictionary *songDict = [[NSDictionary alloc] initWithObjectsAndKeys:
[item valueForProperty: MPMediaItemPropertyTitle], @"title",
[item valueForProperty: MPMediaItemPropertyArtist], @"artists",
nil];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment