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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T23:12:23+00:00 2026-06-12T23:12:23+00:00

My iPhone application is Tab based . In a tab, say Security Tab I

  • 0

My iPhone application is Tab based. In a tab, say Security Tab I have three view controllers First, Second, Third. I am passing a string value to Third view controller from Second view controller. selectedAlertDesc is my NSString object of Third view controller.

In Third view controller:

@property (nonatomic,retain) NSString *selectedAlertDesc;
@synthesize selectedAlertDesc = _selectedAlertDesc;

In Second view controller:

Third *controller = [[Third alloc] init];
[controller setSelectedAlertDesc:[[alertArray objectAtIndex:indexPath.row] objectForKey:@"alertDesc"]];
[self.navigationController pushViewController:controller animated:YES];
[controller release];

It works fine, until I change the tab. If I leave the security tab in Third view controller page and come back after accessing some other tab, it crashes. It states, selectedAlertDesc became zombie.

-[CFString stringByReplacingOccurrencesOfString:withString:]: message sent to deallocated instance 0xeb3d760

How can I solve this issue? I believe we should not initialize synthesized objects. Am I forgetting something here?

EDIT:

As suggested I used instruments for checking allocation/retain history. I got the following:- So after the usage of selectedAlertDesc, I retained it. Is it correct way to do?? And it works properly!!

_selectedAlertDesc = [_selectedAlertDesc stringByReplacingOccurrencesOfString:@"opentag" withString:@"<"];
_selectedAlertDesc = [_selectedAlertDesc stringByReplacingOccurrencesOfString:@"closetag" withString:@">"];
[txtTxtVw setText:_selectedAlertDesc];

enter image description here

  • 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-06-12T23:12:24+00:00Added an answer on June 12, 2026 at 11:12 pm

    From the comments:

    It turns out that the error is caused by code that directly assigns new values to an instance variable instead of using the set... method of the related property (or its corresponding dot notation). This bypasses the property attributes and results in assignment of an autoreleased string.

    (The primary clue is the missing entry in the Instruments retain history.)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a tabController-based iPhone application. First tab is associated with a table view
Within my iPhone application I have a common tab bar with three tabs that
I am new to iphone development.I have created a view based application.Now i want
I have developed an iPhone application with tab bar and navigation controllers. It is
I have a problem with my application for the iPhone. It's a tab based
I have developed an iPhone application based on Tab bar & Navigation bar and
I have a View based application for iPhone/iPod that plays audio, having a VU
I have a tab bar iPhone application with 4 tabs. In the Interface Builder
I have a tab bar along with navigation controller iphone application. Now I need
I'm developing an iPhone application that have a TabBarController with two tabs. Each tab

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.