开发者

How to pass data to table view by array?

开发者 https://www.devze.com 2023-03-09 15:45 出处:网络
I want pass string to table view. In 1st, I can pass to table view but if I pass second string to table view will replace the data.I pass data to table view like this:

I want pass string to table view. In 1st, I can pass to table view but if I pass second string to table view will replace the data. I pass data to table view like this:

NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults];
NSString *myString = [defaults stringForKey:@"keyToLookupString"];
NomberArray = [[NSMutableArray alloc] init];
[NomberArray addObject:myString];

NSLog(@"nomber array = %@",NomberArray);
NSString *nomber = [NomberArray objectAtIndex:indexPath.row];

[开发者_StackOverflowcell.textLabel setText:nomber];

How do I pass more then 2 data to table view?


You probably need to first read the uitableview programming guide. However, your problem seems to be related to populating the tableview. Here's an example of how you do it.

0

精彩评论

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