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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:28:27+00:00 2026-05-22T12:28:27+00:00

I ran into a bug I have trouble explaining. Now that I found the

  • 0

I ran into a bug I have trouble explaining. Now that I found the bug, I can certainly fix it but I would like to understand how such a thing could even happen.

My code:

    NSLog(@"1 - self.nextPlayerButton = %@",self.nextPlayerButton);
    NSLog(@"[self.view setUserInteractionEnabled:TRUE] with self.view=%@",self.view);
    [self.view setUserInteractionEnabled:TRUE];
    NSLog(@"2 - self.nextPlayerButton = %@",self.nextPlayerButton);

where nextPlayerButton is defined as:

@property (retain) IBOutlet UIBarButtonItem  *nextPlayerButton;

The log:

2011-05-15 15:23:05.245 Melimemo[1261:207] 1 - self.nextPlayerButton = <UIBarButtonItem: 0x4b668c0>
2011-05-15 15:23:05.248 Melimemo[1261:207] [self.view setUserInteractionEnabled:TRUE] with self.view=<UIView: 0x4b69750; frame = (0 0; 320 460); autoresize = W+H; layer = <CALayer: 0x4b54290>>
2011-05-15 15:23:05.249 Melimemo[1261:207] 2 - self.nextPlayerButton = <UIBarButtonItem: 0x4b65880>

As you can see, self.nextPlayerButton points to another object the second time around.

The source of my problem is that self.view is actually not properly defined: I initialize an instance of the object in which the code below runs and don’t define what view is. Still, how could invoking setUserInteractionEnabled on anything result in modifying the pointer value of self.nextPlayerButton? Even the beginning of a theory would help.

  • 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-22T12:28:28+00:00Added an answer on May 22, 2026 at 12:28 pm

    More likely is that the self.view call is causing loadView to be invoked, and your button to be set a second time to a new button.

    Try implementing the setter for nextPlayerButton like this:

    - (void)setNextPlayerButton:(UIButton *)button {
        if (button != nextPlayerButton) {
            [nextPlayerButton release];
            nextPlayerButton = [button retain];
        }
    }
    

    Then put a break point in there and run your app. The break point will probably be hit twice. You can look at the stack trace to see why it’s getting hit the unexpected time.

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

Sidebar

Related Questions

I ran into a bug in some code that extracts metadata from some text
I ran into the problem that my primary key sequence is not in sync
I ran into an interesting behavior recently. It seems that if I override .equals()
I ran into a scenario where LINQ to SQL acts very strangely. I would
I ran into an issue with something that I am probably just overlooking. I
I have ran into a very strange issue with Google Maps in Chrome 5.0.375.99:
I recently ran into a very sneaky bug, in which I forget to dereference
I ran into this problem at my old job, and now again at my
I ran into an issue with an IIS web app shutting down an idle
I ran into an interesting (and very frustrating) issue with the equals() method today

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.