Created
November 13, 2012 15:50
-
-
Save jeksys/4066478 to your computer and use it in GitHub Desktop.
iOS\Resource\Property List template
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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