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 1928568
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 17, 20262026-05-17T06:59:41+00:00 2026-05-17T06:59:41+00:00

I have a navigation based iPhone app. When you press on a cell in

  • 0

I have a navigation based iPhone app.
When you press on a cell in the tableview a new UIViewController is pushed to the navigation stack. In this view controller I am setting a custom titleView in the viewDidLoad method:

- (void)viewDidLoad {
    [super viewDidLoad];

    // Setup custom navigation title
    [self setTitle:@"Mediaportal"];
    navItem = [[NavigationBarTitleItemViewController alloc] initWithNibName:@"NavigationBarTitleItem" bundle:nil];
    [navItem setTitle:[theServer name]];
    [navItem setSubTitle:@""];
    [self.navigationItem setTitleView:navItem.view];

…
}

Once I switch back to the RootViewController:

[self.navigationController popToRootViewControllerAnimated:YES];

the app crashes with the following error (NSZombieEnabled=YES):

*** -[CALayer retain]: message sent to deallocated instance 0x5a5fd80

From what I can see the RootViewController still tries to access the custom titleView, which was deallocated with the second view controller. Once I comment out the custom titleView part in my code the app works.
I tried to set the navigationItem.titleView to nil (as found in the apple docs) before the second ViewController is deallocated, but that doesn’t help.

Do you have a hint what I can do to prevent this crash?

Thanks,
Mark.

  • 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-17T06:59:41+00:00Added an answer on May 17, 2026 at 6:59 am

    I finally found the solution for it (a quite simple one).
    I have to alloc and init the navItem through its property then it is being retained:

    self.navItem = [[NavigationBarTitleItemViewController alloc] initWithNibName:@"NavigationBarTitleItem" bundle:nil];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a navigation view with a cell that has something as simple as
I have a page which work like a navigation and a iframe in this
Let's say I have a list of categories for navigation on a web app.
We have a custom navigation webpart that uses the PortalSiteMapProvider of MOSS to build
I have a small tabbed navigation setup using CSS. When hovering over the tabs
I have created some rounded navigation tabs using CSS and am having trouble when
I have a UIView with a navigation bar. How can I hide the navigation
I'm using the following code to have a non-JS navigation: <ol id=navigation> <li id=home><a
I have a page with 3 layers, one for navigation, one for database records
I have a page using <ul> lists for navigation (Javascript changes the styling to

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.