Skip to content

Instantly share code, notes, and snippets.

@jeksys
Created November 13, 2012 15:50
Show Gist options
  • Save jeksys/4066478 to your computer and use it in GitHub Desktop.
Save jeksys/4066478 to your computer and use it in GitHub Desktop.
iOS\Resource\Property List template
<plist version="1.0">
<array>
<dict>
<key>category</key> <string>classic</string>
<key>quote</key> <string>Frankly my dear, I don't give a dam.</string>
<key>source</key> <string>Gone with the wind</string>
</dict>
// 2 - Load movie quotes
NSString *plistCatPath = [[NSBundle mainBundle] pathForResource:@"quotes" ofType:@"plist"];
self.movieQuotes= [NSMutableArray arrayWithContentsOfFile:plistCatPath];
//NSString *my_quote = [self.myQuotes objectAtIndex:index];
NSString *my_quote = self.movieQuotes[index][@"quote"];
// 4 - Display the quote in the text view
self.quoteText.text = [NSString stringWithFormat:@"Quote:\n\n%@", my_quote];
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment