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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T07:44:46+00:00 2026-05-24T07:44:46+00:00

Problem : [NSBundle mainBundle] pathForResource returns null (0x0) I read a lot of posts

  • 0

Problem : [NSBundle mainBundle] pathForResource returns null (0x0)

I read a lot of posts on this topic, here is what I found:

  1. Make sure the file you are trying to get a path to, is in the project. To check, look in the project file list for the file, if it is not there, drag and drop it in.

  2. Check that the file your trying to load is being copied to the app. To do this, click on project under project files (blue bar with project name in it->Click on the target->Click on Build Phases->Click to expand the “copy Bundle Resources”, and make sure your file is in it. If it is not, click the plus, and add it.

  3. Make sure the case matches exactly. (aka – The simulator will work/the app will not problem) Make sure the case matches exactly, otherwise it will return nothing. To fix this, just rename it in the project, or use the right case in the source.

  4. Project may be missing the media framework. To fix this click on your project menu -> click on the target -> click to expand “Link Binary With Libraries”. Now select MediaPlayer.framework and build the code.

  5. If all else fails, clean the project, and try again.

All this is checked/fixed, but not working. I had this working fine, and then I changed the video that I am showing in the app. Since i changed the file, it stopped working.


NSString *path = [[NSBundle mainBundle] pathForResource:@"multiplying" ofType:@"m4v"];

Q: why is it null? The file is case matched/typed correctly and is about 10 megs. (is the file too large?) Works fine in the simulator, and I can get the path to an image, a line above this one, with no error.

  • 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-24T07:44:47+00:00Added an answer on May 24, 2026 at 7:44 am

    You say it’s working in simulator and not working on device?
    May be you should try to copy the file at first launch to one of the application sandbox folders and access it like this:

    NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory,
    NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *pathForTheFile= [documentsDirectory stringByAppendingPathComponent:     @"multiplying.m4v"];
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

here is my problem : The code (FooController) : NSString *path = [[NSBundle mainBundle]
I have problem with NSString *filePaht = [[NSBundle mainBundle] pathForResource:(NSString *)name ofType:(NSString *)ext]; if
SystemSoundID soundID; NSString *path = [[NSBundle mainBundle] pathForResource:@static ofType:@caf]; AudioServicesCreateSystemSoundID((CFURLRef)[NSURL fileURLWithPath:path], &soundID); AudioServicesPlaySystemSound(soundID); I
i've read several thread for this question but unfortunatly not found the answer to
[wordlist writeToFile:[[NSBundle mainBundle] pathForResource:@wordlist ofType:@txt] atomically: YES]; wordlist is a NSMutableArray, and the rest
Problem (simplified to make things clearer): 1. there is one statically-linked static.lib that has
I have a memory leak problem that just can not understand! Watch this initialization
Here is the problem... I am using CA Tiled Layer to display a large
I have seen this question posted here, but always, the answer is that the
hi i had encounter a problem opening a web link through safari. this is

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.