开发者

Passing data from a table view to another when clicking a row in Objective-c

开发者 https://www.devze.com 2023-04-07 15:08 出处:网络
Suppose I have a table view with 5 rows, each row have product name(UiLabel), product photo(UiImageView) and product price(UiLabel).

Suppose I have a table view with 5 rows, each row have product name(UiLabel), product photo(UiImageView) and product price(UiLabel).

When clicking a row, it will be changed to a UiView that sh开发者_如何学编程owing the product name(UiLabel), product photo(UiImageView) and product price(UiLabel), plus a product description(UiLabel).

I want to ask how to pass the data of product name, photos, price and description which is stored in ProductListTableView.m, from this table view to another view ProductDetailView?

ps: I guess I should write some code on method didSelectRowAtIndexPath, but no idea...


yes you have to write code in didSelectRowAtIndexPath-

and follow this to how to pass data from one class to another - Passing data between classes using Objective-C

you can pass a NSDictionary obj from one class to another.

0

精彩评论

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

关注公众号