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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T23:28:15+00:00 2026-06-14T23:28:15+00:00

I have static __weak ExplorerController *_rootExplorer = nil; and _rootExplorer = self; NSAssert(_rootExplorer ==

  • 0

I have

static __weak ExplorerController *_rootExplorer = nil;

and

_rootExplorer = self;            
NSAssert(_rootExplorer == self, @"????");

which works.

In dealloc, I try to do this

bool b = _rootExplorer == self;

which is false, but the debugger clearly states both objects are the same and have the same physical address.

When I do

long n = (long) (_rootExplorer);
long n2 = (long) (self);

I get a very large number for n2 and zero for n. But _rootExplorer is not nil. However, if I do the same thing in other functions that is not dealloc, n and n2 are identical.

What’s wrong with my code? I’m trying to keep a weak reference to one of the navigation controllers in the stack, and during unwinding, I need to release resources but only the referenced controller is allowed to do it.

  • 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-14T23:28:17+00:00Added an answer on June 14, 2026 at 11:28 pm

    Apple’s ARC documentation says, “A weak reference is set to nil when there are no strong references to the object.” So, I don’t think there’s anything wrong with your code (…other than, in some sense, its location being after ARC has done its work).

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

Sidebar

Related Questions

I have this method which return an array of string : private static string[]
I have static java methods which I add to javascript with this method: public
I have static method which returns me as it's name says data from domain
I intended to create a class which only have static members and static functions.
I have a static menu in the sidebar which I include in every JSF
I have this static method on C# : public class MyClass { public MyClass()
I have static width of an element, and an unknown string length which is
I have static class that has a bunch of static properties. When I try
I have a set like this: set<weak_ptr<Node>, owner_less<weak_ptr<Node> > > setName; It works fine.
I have static combo box in html with some default value already selected and

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.