Populating a UITableView from arrays

前端 未结 3 2004
臣服心动
臣服心动 2021-02-11 02:31

I need help with the following code i am using hpple to parse html. and i need help utilizing the data.

-(void) whatever{
NSData *htmlData = [[NSString stringWit         


        
3条回答
  •  囚心锁ツ
    2021-02-11 03:03

    As a general approach, you simply need to set the relevant controller class as a delegate for the UITableView in question and then implement the following methods:

    - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    

    However, I'd recommend reading Apple's Table View Programming guide - it'll elucidate a lot more than a simple code sample, and is reasonably easy to follow.

    Once you've done that, if you're still after sample code simply download one of the projects within the "Related sample code" section of the UITableView Class reference. (If you do this within Apple's doc viewer in Xcode it automates the download, etc. and will bring up the project in Xcode for you.)

提交回复
热议问题