开发者

Populating an array into a TableView

In a tableView I have the following:

NSDictionary *cat = [category objectAtIndex:indexPath.row];  
cell.textLabel.text = [cat valueForKey:@"reference"];

This populates the tableView with the content of the array from an XML file. There is another array “data” that prints out the content to the debug console and I want to populate another view with this content. But I am having lot of trouble populating the next view with the data array.

NSLog(@"cellForRowAtIndexPath-- Reference:%@: Verse:%@", [cat valueForKey:@"reference"], [cat valueForKey:@"data"]);

The didSelectRowAtIndexPath method looks like this:

Verse *vvc = [[Verse alloc] initWithNibName:@"VerseView" bundle:nil];  vvc.verses = [[category objectAtIndex:indexPath.row] valueForKey:@"verse"];  
[self.n开发者_如何学JAVAavigationController pushViewController:vvc animated:YES];  
        [vvc release];  
    [tableView deselectRowAtIndexPath:indexPath animated:YES];   

In the cellForRowAtIndexPath of the next view I have the following:

NSDictionary *cat = [verses objectAtIndex:indexPath.row];  
cell.textLabel.text = [cat valueForKey:@"data"];

What I would like is to have the “data” in a textView.

I don’t know what’s wrong. Any help would be appreciated!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜