开发者

Can I populate a table with just one object from an NSArray? How?

开发者 https://www.devze.com 2023-03-24 14:12 出处:网络
I have a table that is populated by an NSArray mcData in my AppDelegate implementation file. I want to create a detail view with a grouped table that pulls its data from that same array. 开发者_运维技

I have a table that is populated by an NSArray mcData in my AppDelegate implementation file. I want to create a detail view with a grouped table that pulls its data from that same array. 开发者_运维技巧However, I can't seem to figure out a way to use a single object with multiple properties to fill a table. Any ideas, or should I take a different approach?

Thanks!


You can simple use the same array. In the detailed you just retain it @property (nonatomic,retain) NSArray* mcData; In the .m file synthesize it and use it as a datasource for the tableView. Also, don't forget to release it once you are done with the view


You want to map the row index to the property of your object (i.e. 0 = "name", 1 = "zipcode", 2 = "yadayada", etc). Make sense? Is that what you're trying to do?

0

精彩评论

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