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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T20:53:56+00:00 2026-05-25T20:53:56+00:00

My Application is crashes in the device at this point, [[NSBundle mainBundle] pathForResource I

  • 0

My Application is crashes in the device at this point,

[[NSBundle mainBundle] pathForResource

I am giving the path for the pdf here . but at the execution time it is showing that it is not getting path there . and that may be the reason for crashing.

however it is running perfectly on simulator .

i am not able to figure out why is this happening

here is that code

NSString *path = [[NSBundle mainBundle] pathForResource:[myArray objectAtIndex:0] ofType:[myArray objectAtIndex:1]];
NSLog(@"array elemt :%@", [myArray objectAtIndex:0]);
NSLog(@"array elemt 1 :%@", [myArray objectAtIndex:1]);
NSLog(@"path is :%@",path);
NSLog(@"responds to selector mainBundle=%@",[NSBundle respondsToSelector:@selector(mainBundle)]?@"YES""NO");
NSURL *targetURL = [NSURL fileURLWithPath:path];

in this log of the path – when i use device it is showing me nil and when i use simulator it is showing me the path . and it is showing me that is is crashing on NSURL line

  • 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-25T20:53:56+00:00Added an answer on May 25, 2026 at 8:53 pm

    I’ve found that when something like this works on the simulator, but not on the device, it’s likely a problem with the case of the string. Your device is case sensitive but not your computer. Check your string of the file name or the type.

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

Sidebar

Related Questions

My application crashes on this line [NSThread detachNewThreadSelector: @selector(getJSON:) toTarget:self withObject:nil]; Here is how
I've developed my application using my 3G device to test with. Upon giving this
Background: Some time ago, I built a system for recording and categorizing application crashes
The app crashes on the tester's device (with OS 3.1) but does well on
I get this exc_bad_access when I run the application on device ( iPhone 4
I am attempting to simply acquire the user's GPS location, but my application crashes
Is it possible to create device/directx application when pc uses vgasave mode? This is
My C# application crashes under some circumstances when run with a non-admin user. I'm
When an application crashes on Windows and a debugger such as Visual Studio is
When my ASP.NET application crashes (when it shows the default exception page), I'd like

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.