Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- NSString *plistCatPath = [[NSBundle mainBundle] pathForResource:@"candidateList" ofType:@"plist"];
- NSArray *candidateArray = [[NSArray alloc] initWithContentsOfFile:plistCatPath];
- NSMutableArray *candidates = [NSMutableArray new]; //should keep a reference in the header or wherever you keep your variables
- for (NSDictionary *candidateDictionary in candidateArray)
- {
- Candidate *candidate = [Candidate new];
- candidate.name = candidateDictionary[@"name"];
- candidate.politicalView = candidateDictionary[@"politicalView"];
- candidate.age = candidateDictionary[@"age"];
- candidate.region = candidateDictionary[@"region"];
- [candidates addObject:candidate];
- }
- for (Candidate *candidate in candidates)
- {
- //here is where you would build your pages/scrollview/whatever unless you are using a tableview (cellForRowAtIndexPath)
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement