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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:21:12+00:00 2026-06-08T04:21:12+00:00

I’ve just upgraded my application to ARC, but I am having issues with how

  • 0

I’ve just upgraded my application to ARC, but I am having issues with how it handles classes with delegates. Because I am targeting iOS 4.0 and above, I am using __unsafe_unretained and @property (unsafe_unretained) to store the delegate pointers.

However, what I am now finding is that the services (that include delegates) I create in my view controllers are now hanging around after I have removed that view controller, which result in trying to communicate back with the view controller (delegate) after it has been deallocated… And therefore getting an error with Zombies enabled.

How can I update my code in either the view controller or the service, so that when the view controller is removed (popped off the nav controller stack) the service with the delegate pointer also gets removed from memory?

  • 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-08T04:21:13+00:00Added an answer on June 8, 2026 at 4:21 am

    It turns out that it’s not me that’s doing anything wrong…

    The offending NSZombie turned out to be due to the MKMapViewDelegate, which keeps sending ‘mapView:didUpdateUserLocation:’ after the View Controller it belongs to gets deallocated. I know.

    I resolved it by intercepting the Back button in my View Controller, and set the delegate to nil before popping it:

    - (void)backButtonTapped
    {
        self.mapView.delegate = nil;
        [self.navigationController popViewControllerAnimated:YES];
    }
    

    I don’t know why MapKit holds onto a delegate after it has been dealloc’d. If anyone knows I’d be grateful to find out more.

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

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I have just tried to save a simple *.rtf file with some websites and
I want to count how many characters a certain string has in PHP, but
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I need to clean up various Word 'smart' characters in user input, including but
Seemingly simple, but I cannot find anything relevant on the web. What is the
I want to construct a data frame in an Rcpp function, but when I

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.