Added a tableview in a viewcontroller. How do I load tableview cells
Posted
by
user1509593
on Stack Overflow
See other posts from Stack Overflow
or by user1509593
Published on 2012-10-06T21:17:08Z
Indexed on
2012/10/06
21:37 UTC
Read the original article
Hit count: 205
I have a view controller
- In storyboard, added tableview to view controller.
- Created an IBOutlet for tableview to View controller's header file.
- The view controller's header file includes an resultsarray
- Changed the @interface to include delegates <\UITableViewDelegate, UITableViewDataSource>
View controller implementation file has mandatory tableview protocols
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
The view controller has search button in storyboard and IBAction in view controller header file. On click of search button, results are obtained. How do I load the array and redisplay tableview with results in search method. After I loaded the results in array, I tried [self viewdidload];, hoping the cells will be loaded. But didn't. I thought of calling [self.detailView cellForRowAtIndexPath:?indexpath], but dontknow what the value of index path is. Appreciate help from guru's to load the UItableviewcell
Thanks
© Stack Overflow or respective owner