Note that there are some explanatory texts on larger screens.

plurals
  1. POXcode 4.2 Snowleopard Master-Detail Application troubleshooting
    text
    copied!<p>I am a noob at iOS application development.<br/> I trying to create "UITableView -> to Detail View" application.<br/> And found out "Master-Detail Application" project in the project template.</p> <p>Then I tried it out. Then the problem came. I had a dynamic table view, so I have to make the detail view look dynamic too. Like this :</p> <pre><code>Table View Detail View Item A Item A is an &lt;item_A_description&gt;, with &lt;item_A_summary&gt; Item B Item B is an &lt;item_B_description&gt;, with &lt;item_B_summary&gt; Item C Item C is an &lt;item_C_description&gt;, with &lt;item_C_summary&gt; </code></pre> <p>the problem is, after I go back to the table (list) view using back button menu, then I choose the again the item from different row of the list, then the Detail View doesn't changed to selected Item value.<br/> I did pass the value using (MasterView) -> initWithNibName -> (DetailView)<br/> My environment : XCode 4.2 for SnowLeopard, iOS SDK 5</p> <p><strong>Updated</strong><br/> After I check the log, the parameter value did passed with the correct value. But the IBOutlet of UIlabel that I set didn't change it's value.<br/> This is my code : </p> <p>MasterViewController.m:</p> <pre><code>- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath { TheItems *a = [data objectAtIndex:[indexPath row]]; if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { if (!self.detailViewController) { self.detailViewController = [[DetailViewController alloc] initWithNibName:@"DetailViewController_iPhone" bundle:nil withItemId:(NSString *)a.itemId]; } [self.navigationController pushViewController:self.detailViewController animated:YES]; [self.detailViewController release]; } } </code></pre> <p>DetailViewController.h : </p> <pre><code>@interface metapsDetailViewController : UIViewController &lt;UISplitViewControllerDelegate&gt; { NSString *itemId; } @property (strong, nonatomic) IBOutlet UILabel * detailItem; @property (nonatomic, retain) NSString *itemId; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil withItemId:(NSString *)itemId; </code></pre> <p>DetailViewController.m :</p> <pre><code>@synthesize detailItem = _detailItem; @synthesize itemId; - (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil withItemId:(NSString *)itemId { self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil]; if (self) { self.title = NSLocalizedString(@"Detail", @"Detail"); self.itemId = itemId; } } - (void)viewDidLoad { self.detailItem.text = self.itemId; } </code></pre> <p>Thanks</p>
 

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