i have project loads array table view, no problem @ all. have created new project, has exact same code, different array, , table view loads blank. it's driving me nuts.
array loads plist follows
'currentcontent strong pointer nsarray private property of parent view.
the plist looks thiscode:- (void) viewdidload { nsstring *path = [[nsbundle mainbundle] pathforresource:@"customercontent" oftype:@"plist"]; nsarray *myarray = [[nsarray alloc] initwithcontentsoffile:path]; currentcontent = myarray; }
table view data source
the data source connected in storyboard. cell reuse identified in storyboard named in code. above code has been entered in subclass of uitableviewcontroller.code:- (nsinteger)numberofsectionsintableview:(uitableview *)tableview { // return number of sections. return 1; } - (nsinteger)tableview:(uitableview *)tableview numberofrowsinsection:(nsinteger)section { // return number of rows in section. return [currentcontent count]; } - (uitableviewcell *)tableview:(uitableview *)tableview cellforrowatindexpath:(nsindexpath *)indexpath { static nsstring *cellidentifier = @"cell"; uitableviewcell *cell = [tableview dequeuereusablecellwithidentifier:cellidentifier]; if (cell == nil) { cell = [[uitableviewcell alloc] initwithstyle:uitableviewcellstyledefault reuseidentifier:cellidentifier]; } cell.textlabel.text = [[currentcontent objectatindex:indexpath.row] objectforkey:@"customerfriendlyfilename"]; cell.detailtextlabel.text = [[currentcontent objectatindex:indexpath.row] objectforkey:@"publicationdate"]; return cell; }
storyboard tableview embedded in navigation controller. navigation controller initial view controller.
have no idea why isn't working. please help.
it defiantly plist. table view populate nsarray object contaning 3 strings @"one", @"two", @"three", not plist.
why isn't plist being recognised?
Forums iPhone, iPad, and iPod Touch iOS Programming
- iPhone
- Mac OS & System Software
- iPad
- Apple Watch
- Notebooks
- iTunes
- Apple ID
- iCloud
- Desktop Computers
- Apple Music
- Professional Applications
- iPod
- iWork
- Apple TV
- iLife
- Wireless
![[img]](proxy.php?image=http%3a%2f%2fi40.tinypic.com%2f34ni8lt.png&hash=22f85948b14629da0707781869a8ee48)
No comments:
Post a Comment