Tuesday, September 24, 2013

ios scrollview shows how incoming data from tableview click

The first page is a tableview, tableview has 10 rows I click on the line 5 into the details page, details page is actually a scrollview, how display tableview first five rows of data. I am now a few tableview regardless of the first few lines, scrollview always shows the first line. New to IOS development. . .
Reply:
Scrollview not always show the first line, but you want it to display the first few lines it shows the first few lines, so that the emergence of this situation is a logical question. In the viewDidLoad or viewWillAppear inside scrollview should you want to load the data displayed.
Reply:
This is the question that you pass by value, you may set the value of the dead, break point did look that way!
Reply:
scrollview inside a contentSize, this is to set the scrollable range, is not this value is set incorrectly ah. .
Reply:
didSelect method we find value pass right
Reply:
Good things to go down to see another day ....
Reply:
didSelect selected when the data structure pass into the can! viewWillAppear inside the structure can be taken out!
Reply:
Your data is given tableView is an Array, when you click on the fifth row, you get from an Array subscript 4 is passed by value to the next screen
Reply:
Ultimately the question is mainly traditional values.
Wanted to come to your UITableView's datasource should be a NSArray / NSMutableArray
Then each row of data you can in
- (Void) tableView: (UITableView *) tableView didSelectRowAtIndexPath: (NSIndexPath *) indexpath
To get in:

id rowData = [array objectAtIndex: [indexPath row]];
This rowData spread to the second controller on it. How can you pass this rowData second controller to define a property to receive.
--------------------------------------------------
@ Property (retain) id rowData;
@ Synthesize rowData;
-------------------------------------------------- -
Return value:
viewcontroller2 * vc2 = [[viewcontroller2 alloc] init];
[Vc2 setRowData: rowData];



Reply:
Should be passed by value problems in the - (UITableViewCell *) tableView: (UITableView *) tableView cellForRowAtIndexPath: (NSIndexPath *) indexPath where you look for what is the value passed to Cell.
Reply:
I ask you this question you sister home. I have encountered this. Do not know how to engage. And I am able to teach you. . .
Or have similar source sent me a copy of yrenjie@126.com
Very grateful

No comments:

Post a Comment