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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T15:40:37+00:00 2026-05-13T15:40:37+00:00

Basically the problem is exactly what the title says. My app works smoothly on

  • 0

Basically the problem is exactly what the title says.

My app works smoothly on the simulator, with no crashes whatsoever.
In fact, the previous version is on the app store. I made minor changes here and there and suddenly it started to crash in a very odd place.

I use [NSBundle mainBundle] resourcepath] in various places in the code to access plist files, images, etc. The first few calls to NSBundle mainBundle] are totally normal-as expected-, however, at some point it returns…

-[NSBundle < null selector>]: unrecognized selector sent to instance 0x10a0e0

…and crashes on the device. Here is the exact code snippet:

-(void) setImageName:(NSString *)s
{
 [imageName release];
 imageName = [s copy];
 NSLog(@"last line before crash"); 
 NSString *imagePath =[[NSBundle mainBundle] resourcePath];
 NSLog(@"Why would it crash before here???"); 

    imagePath = [imagePath stringByAppendingString:imageName];
    imageUI = [[UIImage alloc] initWithContentsOfFile:imagePath];
    [self setNeedsDisplay];
}

To check if that call is really the problem, I saved resourcePath into a string in the first ever call to [NSBundle mainbundle] in the project (the first few calls were totally normal as I stated above) and used that resourcePath string everywhere I needed [NSbundle mainbundle] and voila! no crashes/ leaks, nothing…

I’m totally confused.. Why would that call crash my app on the device but not the simulator?

Edit: using…

NSArray *array = [NSBundle allBundles];
NSBundle *bundle = [array objectAtIndex:0];
NSString *imagePath = [bundle bundlePath];

…instead of [[NSBundle mainBundle] resourcePath] works too. I guess somehow I’m doing something affecting this particular call only.

Edit 2: Here is the backtrace when I set a breakpoint in -[NSObject doesNotRecognizeSelector:] :

#0  0x30e27b98 in -[NSObject doesNotRecognizeSelector:]
#1  0x30dacb18 in ___forwarding___
#2  0x30da3840 in __forwarding_prep_0___
#3  0x0000bcfe in -[CustomTableViewCell setImageName:] at CustomTableViewCell.m:93
#4  0x0000499e in -[RootTableViewController tableView:willDisplayCell:forRowAtIndexPath:] at RootTableViewController.m:469
#5  0x3364d5d0 in -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:withIndexPath:]
#6  0x3364cde0 in -[UITableView(UITableViewInternal) _createPreparedCellForGlobalRow:]
#7  0x335f832c in -[UITableView(_UITableViewPrivate) _updateVisibleCellsNow]
#8  0x335f6514 in -[UITableView layoutSubviews]
#9  0x335f22d8 in -[UIView(CALayerDelegate) _layoutSublayersOfLayer:]
#10 0x32bac1c0 in -[CALayer layoutSublayers]
#11 0x32babedc in CALayerLayoutIfNeeded
#12 0x32bab844 in CA::Context::commit_transaction
#13 0x32bab474 in CA::Transaction::commit
#14 0x32bb35dc in CA::Transaction::observer_callback
#15 0x30da1830 in __CFRunLoopDoObservers
#16 0x30de9346 in CFRunLoopRunSpecific
#17 0x30de8c1e in CFRunLoopRunInMode
#18 0x332e7374 in GSEventRunModal
#19 0x335adc30 in -[UIApplication _run]
#20 0x335ac230 in UIApplicationMain

… Where #3 – CustomTableViewCell.m:93 is NSString *imagePath =[[NSBundle mainBundle] resourcePath]; in the part of the code I posted above.

  • 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-13T15:40:37+00:00Added an answer on May 13, 2026 at 3:40 pm

    A crash on device but not the simulator (and vice versa) is usually caused by a compiled library/framework that is complied for one hardware platform but not the other. Since the simulator runs on intel and the device on arm, this causes odd crashes. Check anything you may have added, especially anything you didn’t compile recently.

    The error -[NSBundle < null selector>]: unrecognized selector sent to instance 0x10a0e0 suggest that for whatever reason the NSBundle class has “forgotten” it has a mainBundle method. Note that it is the selector which is null and not the object as we would expect in a memory related error. That suggest some high level corruption somewhere.

    I would put the following log before any calls to [NSBundle mainBundle];

    NSLog(@"responds to selector mainBundle=%@",[NSBundle respondsToSelector:@selector(mainBundle)]?@"YES":@"NO");
    

    This will tell you if it really is suddenly losing the mainBundle selector.

    Edit01:

    Thanks for your answer. It seems
    Nsbundle states it can respond to
    mainbundle: “responds to selector
    mainBundle=YES”, just before the
    crashing call to [NSBundle mainBundle]

    Hmmm, the crash must be bad enough to cause the wrong error code return. That suggest that the problem might be in the lines immediately before or after the call to mainBundle.

    Given that the crash occurs in CustomTableViewCell, I’m going to guess it’s a problem in a nib. Do you have a subclass of UITableViewCell defined in a nib? Do you have an image defined in the nib? What file type is it? Does the same error occur with a different image or a different nib?

    I do think that the key clue is that it works on the simulator but not on the device. You need to look for things that would behave differently based on the hardware.

    You’ve certainly got a hard one here.

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

Sidebar

Related Questions

Basically my problem stems from a desire to have the textbox portion be white,
I am creating a little testing component and am running into a problem Basically
Basically like using the out keyword. But the problem is with the out keyword,
I am having a problem with binding values in my ActionScript components. I basically
I have a bit of a problem with user controls. Basically what I want
On Vista, I got a problem with the application crash handler. Basically, if something
Good day, I'm having a problem with asp.net 2.0 viewstate. Basically, I want to
Wow crazy title! But here's the problem. In efforts to dry up my school
can anyone help? I have a problem aligning rounded corners in IE6/7. Basically everything
Basically my problem is that i've adapted a piece of code found here http://social.msdn.microsoft.com/Forums/en-US/vemapcontroldev/thread/62e70670-f306-4bb7-8684-549979af91c1

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.