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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T13:56:14+00:00 2026-05-12T13:56:14+00:00

I hope someone can tell me why I’m wrong. Here is a snippet of

  • 0

I hope someone can tell me why I’m wrong. Here is a snippet of my code:

TimeLogAppDelegate *appDelegate = (TimeLogAppDelegate *)[[UIApplication sharedApplication] delegate];

PickFromListViewController * pl = [[PickFromListViewController alloc] initWithNibName:@"PickList" bundle:nil];
pickList = pl;
[pickList setSearchItems:[appDelegate tableListMutableArray:type ] :NSLocalizedString(type,nil)];
pickList.callingViewController = self;
[pl release];
pickList.responseSelector = [[type lowercaseString] stringByAppendingString: @"Selected:"];
pickList.includeNone = YES;
pickList.includeNew = YES;
[self.navigationController pushViewController:pickList animated:YES];

As you can see, I am releasing pl half-way through, just to create the problem. ‘pickList’ is obviously a PickFromListViewController and is declared in the Header. I set it up as a property (@property (nonatomic, retain) PickFromListViewController *pickList;) and I @synthesize it.

My problem is:

after pl is release I get a BAD ACCESS error accessing pickList indicating that the pointer is no longer available, but I thought the fact that pickList is synthesized, it would be retained until I release it at dealloc?

Can someone tell me why I am wrong?

Many 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-12T13:56:15+00:00Added an answer on May 12, 2026 at 1:56 pm

    Setting up your pickList property as (nonatomic, retain) only applies if you access the property via a property accessor, as follows:

    self.pickList = P1;
    

    or

    [self setPickList:P1];
    

    If you simply assign a value to the member variable:

    pickList = P1;
    

    You are bypassing the property accessor methods, so no retain message is sent.

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

Sidebar

Related Questions

hope someone can answer this. Here is some sample code. namespace std { #ifdef
Hi hope someone can tell me what I am doing wrong with my Key
I hope someone can help me here. I'm having trouble loading this variable. Right
I hope someone can help here, we're having an incredibly annoying time with Visual
hope someone can help. I have two tables: Users -UserID -UserName UsersType -UserTypeID -UserID
Hope someone can help i cant seem to get my head around this, i
Hope someone can help me out with this problem I am having. I just
I hope someone can help me with this, as I'm unable to find the
i hope someone can point me in the right direction On a existing html
I hope someone can help, I am trying to enable enable ASP.Net Impersonation under

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.