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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:50:01+00:00 2026-06-10T13:50:01+00:00

So, I’m puzzled by a really weird crash occurring in my app. Background :

  • 0

So, I’m puzzled by a really weird crash occurring in my app.

Background: I have a class CustomButton overriding UIButton. Briefly, the interface looks like:

@interface CustomButton : UIButton
@property (nonatomic, getter = isLoading) BOOL loading;
@end

Implementation:

@implementation CustomButton
@synthesize loading = loading_;

- (id)init {
if ((self = [UIButton buttonWithType:UIButtonTypeCustom])) {
    [self setTitle:NSLocalizedString(@"My Button", nil) forState:UIControlStateNormal];
    [[self titleLabel] setShadowColor:[UIColor blackColor]];
    [[self titleLabel] setShadowOffset:CGSizeMake(0, -1)];

    [self setContentEdgeInsets:UIEdgeInsetsMake(0, 77, 0, 30)];

    UIImage *backgroundImage = [[UIImage imageNamed:@"back.png"] stretchableImageWithLeftCapWidth:77 topCapHeight:0];
    UIImage *highlightedBackgroundImage = [[UIImage imageNamed:@"back_highlighted.png"] stretchableImageWithLeftCapWidth:77 topCapHeight:0];
    [self setBackgroundImage:backgroundImage forState:UIControlStateNormal];
    [self setBackgroundImage:highlightedBackgroundImage forState:UIControlStateHighlighted];

    [self sizeToFit];
    }

    return self;
}

- (void)setLoading:(BOOL)loading {

    if (loading_ != loading) {
       // Do fancy things
    }
}
@end

Problem: I’m trying to use the button in a class, so I have property and so on:

...
@property(nonatomic, strong) CustomButton *customButton;
...
@syntesize customButton = customButton_;
...
- (void)aMethod {
  self.customButton.loading = YES;
}
...

The button, of course, is initialized.
Then, upon executing the statement self.bookButton.loading = YES, I get this error

 2012-08-28 12:54:25.091 MyApp[9465:15803] -[UIAccessibilityBundle
 setLoading:]: unrecognized selector sent to instance 0x8650cc0
 2012-08-28 12:54:25.091 MyApp[9465:15803] *** Terminating app due
 to uncaught exception 'NSInvalidArgumentException', reason:
 '-[UIAccessibilityBundle setLoading:]: unrecognized selector sent to
 instance 0x8650cc0'
 *** First throw call stack: (0x1ead022 0x203ecd6 0x1eaecbd 0x1e13ed0 0x1e13cb2 0x26bf5 0x257ce 0xfa938f 0xfa96a4 0xfa99a7 0xfb8aea
 0x11600be 0x11603c7 0x1160436 0xf10e49 0xf10f34 0xc5bcaac 0xe04b54
 0x272e509 0x1de4803 0x1de3d84 0x1de3c9b 0x27887d8 0x278888a 0xee0626
 0x14cce 0x27b5 0x1) terminate called throwing an exception

I honestly have no idea about what to look for. It’s either something really really stupid, or something really subdle.
I’ve been searching on google/stackoverflow already of course, but I didn’t manage to get an answer.
Usually that error occurs, as far as I know, when the object doesn’t “understand” the sent message, but this shouldn’t be the case. I don’t even get a warning from the compiler.

If you have even just an idea of what I could look for or you want more details, let me know, thanks.

EDIT: forgot to specify that I am using ARC.

UPDATE: In the answers below Phillip Mills said that it might have been a premature memory release issue. It’s a good point, but Instrument didn’t find any zombie. Moreover, I’ve put a log right before the crashy statement, where I try print information about the CustomButton object and few things related to a UIButton, like the title. Everything looks ok. The title is the one I’ve set, the frame is there and so on… so I believe the object (an actual UIButton) exists and it’s also the expected one. The only thing is the “loading” property that messes everything up.

SOLUTION: the init method was the source of the problem. Instead of initializing an instance of the subclass of the button, it was initializing an instance of UIButton. So, conequentely, no “loading” properties could be found. Substituting init with initWithFrame and using the standard procedure to override the initializer, everything works great.
Still a mistery, though, the reason why I got UIAccessibilityBundle as the origin of the error and not a UIButton.

  • 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-10T13:50:03+00:00Added an answer on June 10, 2026 at 1:50 pm

    Are you casting anything to (CustomButton *) in your app? Double-check the casts – you might be incorrectly casting something that’s not a CustomButton and storing the result in the customButton property.

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

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I have a .ini file as follows: [playlist] numberofentries=2 File1=http://87.230.82.17:80 Title1=(#1 - 365/1400) Example
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 have a jquery bug and I've been looking for hours now, I can't
this is what i have right now Drawing an RSS feed into the php,
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I am doing a simple coin flipping experiment for class that involves flipping a
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this

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.