Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7629131
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T05:45:21+00:00 2026-05-31T05:45:21+00:00

I am a noob at iOS application development. I trying to create UITableView ->

  • 0

I am a noob at iOS application development.
I trying to create “UITableView -> to Detail View” application.
And found out “Master-Detail Application” project in the project template.

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 :

Table View      Detail View
  Item A            Item A is an <item_A_description>, with <item_A_summary>
  Item B            Item B is an <item_B_description>, with <item_B_summary>
  Item C            Item C is an <item_C_description>, with <item_C_summary>

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.
I did pass the value using (MasterView) -> initWithNibName -> (DetailView)
My environment : XCode 4.2 for SnowLeopard, iOS SDK 5

Updated
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.
This is my code :

MasterViewController.m:

- (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];
    }
}

DetailViewController.h :

@interface metapsDetailViewController : UIViewController <UISplitViewControllerDelegate>
{
    NSString *itemId;
}
@property (strong, nonatomic) IBOutlet UILabel * detailItem;
@property (nonatomic, retain) NSString *itemId;
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil withItemId:(NSString *)itemId;

DetailViewController.m :

@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;
}

Thanks

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T05:45:23+00:00Added an answer on May 31, 2026 at 5:45 am

    You only create the detailViewController when it doesn’t exist. The Item you give to the detailViewController is in your init, so the item will only be set once. You should add a method (or property) to your detailViewController where you can set the item, so that it can change your detailViewController when you get new data.

    Edit: Implement something like this:

    @synthesize itemId = _itemId;
    
    -(void)setitemId:(NSString*)itemId{
    
        if(_itemId != itemId)
        {
            [_itemId release];
            _itemId = [itemId retain];
            self.detailItem.text = _itemId;
        }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am noob and new in development iphone application so i want to create
noob question regarding ios development. In a previous project, I have a UITableViewController, to
noob here still experimenting with templates. Trying to write a message processing class template
Noob question. :) I'm trying to add Margin to a Header through out my
Noob question here, but I am teaching myself C and trying to figure out
I'm diving into iOS development and I have a quick noob question about Core
Noob dumb question, no doubt -- but here it is: Trying to tutorialize myself
noob question on c#: how to create a one-dimensional dynamic array? And how to
complete noob to Haskell here with probably an even noobier question. I'm trying to
I am an IOS noob and this may be a dumb question, so here

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.