Reputation: 383
i fetch data from server and populate VableView according to income data array. I want to my app display the details of the string in a new view when the user clicks on the cell. I've populated the TableView and connected a new view and can push new view by clicking the cell, but i have no idea about how to connect all elements of array with the second view.
//the result is JSON data i bring from a url
NSMutableArray *messageContentArray= [[result objectForKey:@"message"] valueForKey:@"message"];
NSUserDefaults *savedContec=[NSUserDefaults standardUserDefaults];
[savedContec setObject:messageContentArray forKey:@"messageArray"];
This is my code of parsing the data and saving it and:
NSArray *someThing=[[NSUserDefaults standardUserDefaults] valueForKey:@"messageArray"];
cell.textLabel.text= [someThing objectAtIndex:indexPath.row];
// NSString *st= [someThing substringToIndex:10];
// i will show first 10 charakters from the message as the cell.textlabe.tex but haven't
// prepared that part.. What i want is, when i click a cell, in the second view display
// all the text for that element of array
this is how i populate the tableview cells. As i explained in the code, when i click a cell, i want to display all the text for that element of array in the second view.
NOTE: I have prapared views and connections
Upvotes: 0
Views: 166
Reputation: 3231
wether u have done any sample app, how to display the data onto views...
check the below sample
http://www.raywenderlich.com/1797/how-to-create-a-simple-iphone-app-tutorial-part-1
there are 3 parts in this tutorial, go through it, u will come to know how to use it in ur app.
Upvotes: 1