Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Let me clarify what I did and what I want to do.</p> <p>Here is my UItableView and UITableViewCell creation under FourthViewController;</p> <pre><code>- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *countryIdentifier = @"countryIdentifier"; UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:countryIdentifier]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"countryIdentifier"]; cell.selectionStyle = UITableViewCellSelectionStyleNone; } NSString *cellValue = [NSString stringWithFormat:@"%@, %@", [countries objectAtIndex:indexPath.row], [rates objectAtIndex:indexPath.row]]; cell.textLabel.text = cellValue; cell.textLabel.font = [UIFont fontWithName:@"HelveticaNeue-Bold" size:16]; cell.selectionStyle = UITableViewCellSelectionStyleGray; return cell; } </code></pre> <p>Here is what happens after one of the cell is tapped in FourthViewController;</p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { [tableView deselectRowAtIndexPath:indexPath animated:YES]; NSString *msg = [[NSString alloc] initWithFormat: @"%@ rate for %@ has been selected", [rates objectAtIndex:[indexPath row]], [countries objectAtIndex:[indexPath row]]]; UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"New country selected" message:msg delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil]; [alert show]; [alert release]; [msg release]; fCountry = [countries objectAtIndex:indexPath.row]; fRate = [rates objectAtIndex:indexPath.row]; } </code></pre> <p>fCountry and fRate are the strings that I'm storing the tapped cell data inside. They are synthesized properly. And I want to use the cell info stored into those two strings in a textfield placed in another ViewController, named FirstViewController.</p> <p>Here is how I tried to use the strings from FourthViewController in FirstViewController;</p> <pre><code>#import "FourthViewController.h" @interface FirstViewController : UIViewController{ ... IBOutlet UITextField *taxRateField; FourthViewController *fourthViewController; } ... @property (nonatomic, retain) IBOutlet UITextField *taxRateField; @property (nonatomic, assign) FourthViewController *fourthViewController; ... @end </code></pre> <p>In the FourthViewController.m;</p> <pre><code>#import "FirstViewController.h" #import "FourthViewController.h" @implementation FirstViewController ... @synthesize taxRateField; @synthesize fourthViewController; - (void)viewWillAppear:(BOOL)animated { ... taxRateField.text = fourthViewController.fRate; } </code></pre> <p>I implemented every necessary data and made connections of IBOutlets properly but I'm sure that I'm missing something really small. </p> <p>Thank you again!</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload