how to view image in detailview controller in tableview? - ios

hi I'm developing a iOS which featuring image updates. For using the NSURLConnectionDelegate and setDatasource to bring the image to tableview with help of php and json now I'm trying give a detail view option for the my table view going as tough time in this can please help me.
the setdatasource coding the imagecell.m
-(void)setDataSource:(image *)inImageObj
{
self.decriptionLabel.text = inImageObj.desp;
NSURL *url = [NSURL URLWithString:inImageObj.img];
NSURLRequest *request = [NSURLRequest requestWithURL:url];
connection = [[NSURLConnection alloc] initWithRequest:request delegate:self];
self.responseData = [[NSMutableData alloc] init];
}
- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data;
{
[self.responseData appendData:data];
}
- (void)connectionDidFinishLoading:(NSURLConnection *)connection;
{
UIImage *image = [UIImage imageWithData:self.responseData];
self.thumbImageView.image = image;
}
this is code I used for view the images in table view.m
-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath: (NSIndexPath *)indexPath
{
static NSString *cellIdentifier =#"Cell";
imgpoliticalCell *cell =(imgpoliticalCell *)[tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell== nil) {
cell = [[imgpoliticalCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:cellIdentifier];
}
[cell setDataSource:[imgevery objectAtIndex:indexPath.row]];
return cell;
}
now I want view the image and description in the detailviewcontroller. I tried with segue i not able to get it properly
detailviewcontroller.h file
#interface DetailpoliticalViewController : UIViewController
#property (strong,nonatomic) UIImage * image;
#property (strong,nonatomic) NSString * data;
#property (strong, nonatomic) IBOutlet UIImageView *imageview;
#property (strong, nonatomic) IBOutlet UILabel *view;
this is code I have used in the detailviewcontroller.m file
#implementation DetailpoliticalViewController
#synthesize imageview,view;
#synthesize image,data;
- (void)viewDidLoad
{
[super viewDidLoad];
self.imageview.image = self.image;
self.view.text= self.data;
// Do any additional setup after loading the view.
}
And this is the push segue code which I have used in the table view controller
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:#"Detailsegue"]) {
DetailpoliticalViewController *detailvc =(DetailpoliticalViewController *)segue.destinationViewController;
NSIndexPath *indexPath =[self.mytableview indexPathForCell:(UITableViewCell *) sender];
image * eve = [imgevery objectAtIndex:indexPath.row];
[detailvc setDataSource:[imgevery objectAtIndex:indexPath.row]];
}
Now I'm not able to view the image and description in my detail view controller I'm getting the nil exception error
please can any one suggest some way to view the details
thanks in advance

Use
NSIndexPath *indexPath =[self.mytableview indexPathForSelectedRow];
instead of
NSIndexPath *indexPath =[self.mytableview indexPathForCell:(UITableViewCell *) sender];

check this:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
[self performSegueWithIdentifier: #"DetailSegue" sender: self];
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:#"DetailSegue"]) {
DetailpoliticalViewController *detailvc =(DetailpoliticalViewController *)segue.destinationViewController;
indexPath = [self.tableView indexPathForSelectedRow];
image * eve = [imgevery objectAtIndex:indexPath.row];
[detailvc setDataSource:[imgevery objectAtIndex:indexPath.row]];
}
}
Check this tutorial LINK 1

You can do this by implementing this two method:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self performSegueWithIdentifier:#"Detailsegue" sender:indexPath];
}
and below method
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:#"Detailsegue"]) {
DetailpoliticalViewController *detailvc =(DetailpoliticalViewController *)segue.destinationViewController;
NSIndexPath *indexPath = (NSIndexPath *)sender;
image * eve = [imgevery objectAtIndex:indexPath.row];
[detailvc setDataSource:[imgevery objectAtIndex:indexPath.row]];
}
}

Related

UIWebView from UITableview from TabBarController not loading

Trying to load a url being passed from the previous viewcontroller in a tabviewcontroller sequence. Checked the usual suspects. UIWebview is added view outlet. All the proper delegate are connected. I'm not sure if the NSURL is being passed to the next view controller as I get a black screen (although the response object isn't nil). It's driving me crazy because it's a simple problem and it's something I've done millions of times but it's not working. Any help would be appreciated.
Below you'll find the code.
SquirrelInformationTableViewController.m
#interface ASAInformationTabViewController (){
NSMutableArray *squirrelArray;
}
#property (nonatomic, strong) ODRefreshControl *refreshControl;
#property (weak, nonatomic) IBOutlet UITableView *squirrelListTableView;
#end
#implementation ASAInformationTabViewController
- (void)viewDidLoad {
[super viewDidLoad];
[self setUpSquirrelList];
//Add drag to refresh function
self.refreshControl = [[ODRefreshControl alloc]initInScrollView:self.squirrelListTableView];
self.refreshControl.tintColor = [UIColor colorWithRed:46.0/255 green:172.0/255 blue:247.0/255 alpha:1];
[self.refreshControl addTarget:self action:#selector(dragToRefreshAction:) forControlEvents:UIControlEventValueChanged];
}
-(void)setUpSquirrelList
{
__weak UITableView* weaktable = self.squirrelListTableView;
[[ASASquirrelManager instance] listSquirrels:^(NSString *response, NSMutableArray *result) {
if ([response isEqualToString:CODE_SUCCESS]) {
squirrelArray = result;
dispatch_async(dispatch_get_main_queue(), ^{
if (weaktable) {
[weaktable reloadData];
}
});
}
}];
}
-(UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
ASASquirrelInformationTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:#"squirrelIdentifier"];
ASASquirrelModel *squirrelLocal = squirrelArray[indexPath.row];
cell.squirrelTitleLabel.text = squirrelLocal.title;
cell.squirrelDescLabel.text = squirrelLocal.desc;
NSData *imageData = [[NSData alloc] initWithContentsOfURL:
[NSURL URLWithString:squirrelLocal.image]];
cell.squirrelImage.image = [UIImage imageWithData:imageData];
return cell;
}
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
ASASquirrelModel *squirrelWebLocal = squirrelArray[indexPath.row];
NSString *squirrelURLString = squirrelWebLocal.url;
//create an array with the string you want an access it
NSLog(#"%#", urlStringArray);
//Create a string from the URL pass it to the sdvc.string
SquirrelDetailViewController *sdvc = [SquirrelDetailViewController new];
sdvc.urlString = squirrelURLString;
[self.navigationController pushViewController:sdvc animated:YES];
}
SquirrelDetailViewController.m
#interface SquirrelDetailViewController () <UIWebViewDelegate>
#end
#implementation SquirrelDetailViewController
- (void)viewDidLoad {
[super viewDidLoad];
self.webView.frame = self.view.bounds;
[self.view addSubview:self.webView];
}
-(void)viewWillAppear:(BOOL)animated
{
self.urlstr = [NSURL URLWithString:self.urlString];
NSURLRequest *requestObj = [NSURLRequest requestWithURL:self.urlstr];
[self.webView loadRequest:requestObj];
}
I think you need to create the instance of the sdvc using storyboard otherwise it will not be getting instantiated properly. So:
SquirrelDetailViewController *sdvc =
(SquirrelDetailViewController *)[[UIStoryboard storyboardWithName:#"XXX" bundle:nil] instantiateViewControllerWithIdentifier:#"YYY"];
where XXX is your storyboard name and YYY is the storyboard identifier for SquirrelDetailViewController.
I found out that the trouble was I wasn't preparing for segue. (hits forehead*)
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[self performSegueWithIdentifier:#"webviewpush" sender:self];
}
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:#"webviewpush"]) {
// Get destination view
SquirrelDetailViewController *vc = [segue destinationViewController];
NSIndexPath *path = [self.squirrelListTableView indexPathForSelectedRow];
ASASquirrelModel *squirrelWebLocal = squirrelArray[path.row];
NSString *squirrelURLString = squirrelWebLocal.url;
vc.urlString = squirrelURLString;
}
}
If you'll excuse me I'm going to go drown myself now.

tableview segue to another view controller

I am new to programming and am probably hung up on a simple problem. I am using parse for my array in my tableview. When the row is selected i want to segue to a search bar on another view controller. The segue works fine and the tableview works fine but i can't seem to get the objectId to pass.
#import "bookmarkViewController.h"
#import "Parse/Parse.h"
#import <ParseUI/ParseUI.h>
#import "ViewController.h"
#implementation bookmarkViewController
#synthesize postArray;
#pragma mark - View lifecycle
- (void)viewDidLoad
{
[super viewDidLoad];
[self.navigationItem setLeftBarButtonItem:[[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemRefresh target:self
action:#selector(refreshButtonHandler:)]];
}
- (void)viewWillAppear:(BOOL)animated
{
if ([PFUser currentUser])
[self refreshButtonHandler:nil];
}
#pragma mark - Button handlers
- (void)refreshButtonHandler:(id)sender
{
//Create query for all Post object by the current user
PFQuery *postQuery = [PFQuery queryWithClassName:#"Post"];
[postQuery whereKey:#"author" equalTo:[PFUser currentUser]];
// Run the query
[postQuery findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) {
if (!error) {
//Save results and update the table
postArray = objects;
[self.tableView reloadData];
}
}];
}
#pragma mark - Table view data source
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:
(NSInteger)section
{
// Return the number of rows in the section.
return postArray.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:
(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView
dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
}
// Configure the cell with the textContent of the Post as the cell's text label
PFObject *post = [postArray objectAtIndex:indexPath.row];
[cell.textLabel setText:[post objectForKey:#"textContent"]];
return cell;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath
*)indexPath{
NSLog(#"cell tapped");
PFObject *post = [postArray objectAtIndex:indexPath.row];
NSLog(#"%#", post.objectId);
[self performSegueWithIdentifier:#"searchBookmark" sender:self];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
ViewController *vc = [segue destinationViewController];
vc.labelText = post.objectId;
}
}
#end
at vc.label.text i always get use of undeclared identifier "post" but i can't seem to figure out how to get it recognized. It is in the above method.
the NSLogs reply correctly 16:17:27.513 [App] cell tapped
[App] cgdVY7Eu9h
Change your didSelectRowAtIndexPath and prepareForSegue to this:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath* )indexPath{
[self performSegueWithIdentifier:#"searchBookmark" sender:self];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
NSLog(#"cell tapped");
PFObject *post = [postArray objectAtIndex:indexPath.row];
NSLog(#"%#", post.objectId);
ViewController *vc = [segue destinationViewController];
vc.labelText = post.objectId;
}
}
Post is a local variable that you created inside didSelectRowAtIndexPath, so it can't be used outside that method. The easy way to fix this, is to pass post as the sender argument in performSegueWithIdentifier:sender:. You can pass any object you want as the sender.
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath*)indexPath {
NSLog(#"cell tapped");
PFObject *post = [postArray objectAtIndex:indexPath.row];
NSLog(#"%#", post.objectId);
[self performSegueWithIdentifier:#"searchBookmark" sender:post];
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
PFObject *post = (PFObject *)sender;
ViewController *vc = [segue destinationViewController];
vc.labelText = post.objectId;
}
UIViewController -> segue -> UITableViewController
I had one problem that i solved with answer -1- Thanks.
So i had a kind of UIViewController and i wanted with button just segue to another UITableViewController and i noticed that it stacked and was frozen. I could not scroll my Table ...
My Code was :
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
MasterViewController *controller =segue.destinationViewController;
controller.modalTransitionStyle = UIModalTransitionStyleCoverVertical;
[self presentViewController:controller animated:YES completion:nil];
}
My CPU was over 100% overloaded.
So the answer number 1 worked for me well. New Code is then :
-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender{
MasterViewController *vc = [segue destinationViewController];
}
and the table with 30 entries works now just like a charm =)

Pass JSON data to another View

I have a TableView that load JSON content from web.
I use AFNetworking and JSONModel. And I use this tutorial do Receive and Parse the Data
Here is the code.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *identifier = #"CellIdentifier";
__weak ProgramacaoTableCell *cell = (ProgramacaoTableCell *)[self.tableView dequeueReusableCellWithIdentifier:identifier];
ProgramacaoModel* programacao = _programacao.programacaoArray[indexPath.row];
// NameLabel is the Label in the Cell.
cell.nameLabel.text = [NSString stringWithFormat:#"%#", programacao.atracao ];
return cell;
}
I want to know how pass this data to a Detail ViewController.
In my DetailViewController i have the properties to receive the data.
#property (nonatomic, strong) IBOutlet UILabel *programacaoNomeLabel;
You can access to your controller through your navigation:
NSArray* vcStack=[self appDelegate].myNavigationController.viewControllers;
UIViewController* vcUnder;
if(vcStack.count > 0)
vcUnder=[vcStack objectAtIndex:(vcStack.count-1)];
// -1 depends when you called your controller that's why we test the kind of class
if([vcUnder isKindOfClass:[DetailViewController class]]){
((DetailViewController*) vcUnder). programacaoNomeLabel = #"some data";
}
I find the answer
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
// Pass the selected object to the new view controller.
if ([[segue identifier] isEqualToString:#"pushDetalhesView"]) {
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
// Pega o objeto da linha selecionada
ProgramacaoModel *object = [_programacao.programacaoArray objectAtIndex:indexPath.row];
// Pass the content from object to destinationViewController
[[segue destinationViewController] getProgramacao:object];
}
}
In my Details ViewController I create an iVar
#interface ProgramacaoDetalhesViewController ()
{
ProgramacaoModel *_programacao;
}
And set two method, one to receive the content and another to set the Labels
- (void) getProgramacao:(id)programacaoObject;
{
_programacao = programacaoObject;
}
- (void) setLabels
{
programacaoNomeLabel.text = _programacao.atracao;
}

UIDetailView does not load data when didSelectRowAtIndexPath is called

In my TableViewController, I set the data I want to load in my DetailView (ws)
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath sender:(id)sender{
detailViewController *detailVC = [[detailViewController alloc] init];
detailVC.ws = [self.tabAssociation objectAtIndex:indexPath.row];
[detailVC viewDidLoad] ;
//detailVC.descriptionTextView = [[UITextView alloc] init];
//[self.navigationController pushViewController:detailVC animated:YES];
}
And this is what my DetailView must load
- (void)viewDidLoad
{
[super viewDidLoad];
self.barre.title = self.ws.associationName ;
self.descriptionTextView.text = self.ws.associationDescription ;
}
But when I select the row, a white page appears and not my associationDescription in a text view, neither my associationName
But my viewDidLoad seems to be called before detailVC.ws is loaded, ie my detailVC is empty
Here is my TableViewController.h
import UIKit/UIKit.h
#interface MasterViewController : UITableViewController{
NSArray *tabAssociation;
}
#property (nonatomic, retain) NSArray *tabAssociation;
#end
And the TableViewController.m
#import "MasterViewController.h"
#import "DetailViewController.h"
#interface MasterViewController () {
}
#end
#implementation MasterViewController
#synthesize tabAssociation ;
- (void)awakeFromNib
{
[super awakeFromNib];
}
- (void)viewDidLoad
{
[super viewDidLoad];
NSArray *dictFromFile = [[NSArray alloc] initWithContentsOfFile:[[NSBundle mainBundle]pathForResource:#"AssociationTest" ofType:#"plist"]];
NSMutableArray *associationToAdd = [[NSMutableArray alloc] init];
NSEnumerator *enumerator = [dictFromFile objectEnumerator];
NSDictionary *anObject;
while ((anObject = [enumerator nextObject])) {
association *newAssocition = [[association alloc] initWithDictionaryFromPlist: anObject];
[associationToAdd addObject: newAssocition];
}
self.tabAssociation = [NSArray arrayWithArray:associationToAdd];
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return 1;
}
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
return self.tabAssociation.count;
}
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier];
}
// On récupère l'objet Website qui correspon à la ligne que l'on souhaite afficher
association *ws = [self.tabAssociation objectAtIndex:indexPath.row];
cell.textLabel.text = ws.associationName;
// On renvoie la cellule configurée pour l'affichage
return cell;
}
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the specified item to be editable.
return YES;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath sender:(id)sender{
detailViewController *detailVC = [[detailViewController alloc] init];
detailVC.ws = [self.tabAssociation objectAtIndex:indexPath.row];
//[detailVC viewDidLoad] ;
[self presentViewController:detailVC animated:YES completion:nil];
//detailVC.descriptionTextView = [[UITextView alloc] init];
//[self.navigationController pushViewController:detailVC animated:YES];
}
/*- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([[segue identifier] isEqualToString:#"showDetail"]) {
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
NSDate *object = _objects[indexPath.row];
[[segue destinationViewController] setDetailItem:object];
}
}*/
#end
You should never call -viewDidLoad directly. What you want to do is present you detailViewController somehow.
If you're inside a UINavigationController, something like:
[self.navigationController pushViewController:detailVC animated:YES];
should work. If you're not, then you have to think about how you're going to present your view controller.
You can try something like:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath sender:(id)sender{
detailViewController *detailVC = [[detailViewController alloc] init];
detailVC.ws = [self.tabAssociation objectAtIndex:indexPath.row];
[self presentViewController: detailVC animated:YES completion:nil];
}

Transfering NSString from prototype cell not working with prepareForSegue

I am just trying to transfer a simple string from a UILabel in a prototype cell into a label in the next View Controller. Value of label.text in the viewDidLoad of the View Controller is returning (null).
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = #"Cell";
mainCell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (mainCell == nil) {
mainCell = [[dictionaryTableCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
}
NSString* date = [dateArray objectAtIndex:indexPath.row];
mainCell.viewLabel.text = date;
return mainCell;
}
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:#"View Segue"]) {
NSLog(#"View Load Segue Success");
ViewController *one = segue.destinationViewController;
one.label.text = mainCell.viewLabel.text;
}
}
What am I doing wrong here?
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:#"View Segue"]) {
NSLog(#"View Load Segue Success");
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
ViewController *one = segue.destinationViewController;
one.label.text = [dateArray objectAtIndex:indexPath.row];
}
}
And actually, assigning text to text label you should do in your viewController one's method(viewDidLoad or viewWillAppear). So, you need to make a property in viewController one for transferring NSString.
You can use indexPathForSelectedRow:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
if ([segue.identifier isEqualToString:#"View Segue"]) {
ViewController *one = segue.destinationViewController;
NSIndexPath *indexPath = [self.tableView indexPathForSelectedRow];
one.textProperty = [dateArray objectAtIndex:indexPath.row];
}
}
Or you can also use sender if your segue is from the cell to the next scene, e.g.:
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender
{
if ([segue.identifier isEqualToString:#"View Segue"])
{
ViewController *one = segue.destinationViewController;
NSAssert([sender isKindOfClass:[UITableViewCell class]], #"Not cell");
UITableViewCell *cell = sender;
NSIndexPath *indexPath = [self.tableView indexPathForCell:cell];
one.textProperty = [dateArray objectAtIndex:indexPath.row];
}
}
Two things to note:
As a matter of good programming style, I am not retrieving the text value from the cell. I'm retrieving the text value from the model. You should not be relying upon the view for information to be passed along. Go back to the model, the original source of the information.
Do not set the text property of the label in the destination controller directly. The controls of the destinationController have not been created yet. You should defer setting controls until the destinationController's viewDidLoad. So, instead, create a NSString property in the destination controller:
#property (nonatomic, strong) NSString *textProperty;
Clearly, you should use a more descriptive name than textProperty, but hopefully you get the idea. Anyway, prepareForSegue can set this new property and the viewDidLoad of the destination controller should then use that NSString property to populate the text property of the UILabel, e.g.:
- (void)viewDidLoad
{
[super viewDidLoad];
self.label.text = self.textProperty;
}
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
YourViewController *controller =[[YourViewController alloc] init];
[self presentModalViewController:controller animated:YES];
one.label.text = [dateArray objectAtIndex:indexPath.row];
}
Change the label.text after presentModalViewController. Now what happens?
- (void)presentViewController:(UIViewController *)viewControllerToPresent animated: (BOOL)flag completion:(void (^)(void))completion
I understand you are already using Segue. You should follow the other answer.

Resources