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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T17:42:36+00:00 2026-06-09T17:42:36+00:00

Edit: I’m really sorry. I edited the confusing errors I made in my post.

  • 0

Edit: I’m really sorry. I edited the confusing errors I made in my post.

I have these ivars declared in WhereamiViewController.h:

CLLocationManager *locationManager;
IBOutlet MKMapView *worldView;
IBOutlet UITextField *locationTitleField;

The author writes that since WhereamiViewController owns locationManager and locationManager's delegate is the WhereamiViewController, locationManager delegate must be set to nil in the WhereamiViewController's dealloc method because the delegate is assigned instead of weak. In the .xib file worldView and locationTitleField are set to delegate the File's Owner, but why don’t those two delegates need to be set to nil when both of them are also assign instead of weak?

PS: It’s using ARC

  • 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-09T17:42:37+00:00Added an answer on June 9, 2026 at 5:42 pm

    Well you need to set it to nil simply as a precautionary measure. Did I Confuse you? Let me explain.

    The setting to nil has really nothing to do with retain release cycle, it is simply to avoid locationManager sending delegate call to your controller. For instance, if locationManager is updating location meanwhile your controller is released, the locationManager still having the delegate reference set to your view controller, will call the delegate with location parameters.

    But since you controller has been deallocated, the call will result in bad memory access.

    However, if you set it to nil, exception will not be thrown since manipulatin of nil pointers has no affect.

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

Sidebar

Related Questions

EDIT: Sorry about ellipsis that's not what I actually have. For declaring an array
EDIT: I'll try and make it clearer sorry for the confusion. I have two
EDIT: See my answer below--> I am wanting to have a view that when
Edit (updated question) I have a simple C program: // it is not important
EDIT: Here is the edited control file (control.ascx): <%@ Control Language=C# AutoEventWireup=true CodeFile=Sale.ascx.cs Inherits=Enmasse.Modules.Demo_Enmasse.Sale
Edit: The below question was answered by this . I have a new updated
EDIT: Changed as I have a different issue with the same code 2nd Edit:
EDIT: I have reworded the title question slightly, and adjusted the text to respond
EDIT: Problem solved... and unrelated to the phrasing of the question... sorry for the
EDIT: I rephrased the question because I have not explained well. Let's see if

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.