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

  • SEARCH
  • Home
  • 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 7129487
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T11:14:52+00:00 2026-05-28T11:14:52+00:00

On a detail view I’m trying to pull the navigation item’s title which is

  • 0

On a detail view I’m trying to pull the navigation item’s title which is dynamically set from my UITableView. I want to set it as an NSString value – so for example if my title is “potatoes” I want to get that string and set it as a variable in my view controller.

Here’s the code I have so far. I tried setting this new variable as my UILabel text and it always outputs the string “Detail” – I can never seem to get the actual title value.

NSString *theTitleValue = self.navigationItem.title;
self.detailDescriptionLabel.text = theTitleValue;

I should point out that if I manually set a string to my description label (UILabel) it works fine. Only when I’m pulling the self.navigationitem.title does it come back as ‘Detail’

self.detailDescriptionLabel.text = @"Some stuff here LMAO!!!";

So the single line above will output that string in my label. Any thoughts on how I can get the literal string value of my current navigation item?

EDIT:
Here is the code from my table view which pushes this new detail view and title setting. Is there alternatively a way to pass this variable from the table view into the detail view?

What I mean is the value of currentLabel is exactly what I need to grab. However this code below is from MasterViewController.m and I need the currentLabel variable inside DetailViewController.m. I don’t know of any way to pass variables between view controllers, so in my mind the easiest way to solve this would be pulling the value from the DetailViewController’s navigation title.

# MasterViewController.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath 
{
    // creating NSString value for current vegetable in array
    NSString *currentLabel = [self.vegetablesListing objectAtIndex:indexPath.row];
    DetailViewController *detailVC = [self.storyboard instantiateViewControllerWithIdentifier:@"VegetablesDetailViewCont"];

    [self.navigationController pushViewController:detailVC animated:YES];
    detailVC.navigationItem.title = currentLabel;
}
  • 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-28T11:14:53+00:00Added an answer on May 28, 2026 at 11:14 am

    What you could do is set the new UIViewController’s title directly, even along with the navigation controller’s title. Then in your new detail view just call self.title to pull out the value.

    example codes:

    DetailViewController *detailVC = [self.storyboard instantiateViewControllerWithIdentifier:@"DetailViewName"];
    detailVC.title = currentLabel;
    detailVC.navigationItem.title = currentLabel;
    
    [self.navigationController pushViewController:detailVC animated:YES];
    

    then in your detail controller you can check this value with NSLog:

    NSLog(@"%@", self.title);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am simply trying to show detail view page from table page I have
I have a detail view that is pushed from a map. I am trying
I want to create a 'detail view' in my navigation-based app similar to the
I have a detail view that includes three UIButtons, each of which pushes a
I'm trying to create a master detail view of a linq to sql relationship
I want all labels inside a detail view to be bold. I created a
I have a UITabBar in the detail view of my navigation based application. I
I'm using a navigation controller to drill into a detail view when a cell
I am looking for a control which can show me selected image detail view
I have a detail view that includes three UIButtons, each of which pushes a

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.