Passing data from a table view to another when clicking a row in Objective-c
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.
精彩评论