objective c - UITableView is not showing the content of NSArray -
I am creating an app that contains UIPLView. I've added the view view to ViewViewController. This is my ViewController.h < / P>
#import & lt; UIKit / UIKit.h & gt; @ Interface view controller: UIViewController & lt; UITableViewDataSource, UITableViewDelegate & gt; @ Property (weak, non-monomitive) IBotlet UITWview * Tableview; @end
and the following is My ViewController.m
#import "ViewController.h" @interface ViewController () @end @implementation ViewController {NSArray * Tabledata; } @ Synthesis table view; - (zero) viewDidoadload [[Super Viewedload]; Tabledata = [Object with NSArray array: @ "Egg Benedict", @ "Mushroom Risotto", @ "full breakfast", @ "hamburger", @ "ham and egg sandwich", zero]; Tableview.delegate = self; // Setup an additional after loading the view, usually from a nib } - (NSInteger) Table view: (UITableView *) table view numberoffloss insaction: (NSInteger) section {return [tabledata count]; } - (CGFloat) Table view: (UITableView *) Table view height forRowAtIndexPath: (NSIndexPath *) indexPath {return 150.0; } - (UITableViewCell *) TableView: (UITableView *) Table View CellForAind Pound: (NSIndexPath *) Indexed Pathith {Static NSString * simpleTableIdentifier = @ "SimpleTableItem"; UITableViewCell * cell = [TablesView decomputer reusableWelcome Identifier: SimpleTable Identifier]; If (cell == blue) {cell = [[Uaitibl wee Aelel] Initvith Style: Uaitiblwuselstail default Riug Idaantifayr: Srlteblaidentifayr]; } Cell.textLabel.text = [tabledata objectAtIndex: indexPath.row]; Return cell; } - (zero) did risiv memorialisation [[super daviditamammy warning]; // Any resource settlement which can be reproduced. } @ And
When I am running this program, it shows me the table but there is no data in it and the number of rows is also not equal to 5. Please help me in advance thanks
Modified code from view imported
Tabledata = [Object with NSArray array: @ "Egg Benedict", @ "Mushroom Risotto", @ "full breakfast", @ "Hamburger", @ "ham and egg sandwich", zero]; Tableview.delegate = self; Tableview.dataSource = self;
Comments
Post a Comment