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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:53:58+00:00 2026-05-27T04:53:58+00:00

In my code I want to open a html file, so added the following

  • 0

In my code I want to open a html file, so added the following line of code:

NSString* path = [[NSBundle mainBundle] pathForResource:@”cheese” ofType:@”html”];

But it fails as path is nil after execution. The file cheese.html exists and has been added to the project’s resources.

I couldn’t, and still can’t figure out why its not working. I have a few other projects that open and read files so as an experiment I copied the line of code that is failing to one of these other projects, and along with it I dragged/dropped the cheese.html file from the project where it doesn’t work to this other project (dragged and dropped from within xcode’s hieararchical project file view), and bingo – the line executes and path is not nil in that other project.

So I’m totally mystified, why is it working in one project but not another?

Its the exact same line of code in both, and as the file was dragged and dropped its the same file, and as the file was dragged from within xcode itself, it proves the file has been added to the projects resources. So why would it still fail?

  • 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-27T04:53:59+00:00Added an answer on May 27, 2026 at 4:53 am

    Check this:

    In the left hand organizer select your project. Then in the next navigator over Select your target name. Then Select the build phases ‘tab’. You will see a section ‘Copy Bundle Resources’. Make sure the resource you are looking for is listed there. If it is not add it.

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

Sidebar

Related Questions

I want to open an xlsx file, I have tried the below code,but neither
If I want to combine asp.net code with html (mark up) file, I need
I want to insert code for Open Id. I am unable to find article
In the following code I want to replace every occurrence of U.S.A with united
I have the following code I want to run, but the problem is $this->type
As the title says, I want the ‘select file’ dialog to open when a
this my code $z = new ZipArchive(); if ($z->open('file.zip')) { for ($i=0; $i<$z->numFiles;$i++) {
I am developing an android application, that should open html 5 file when it
I want code to run whenever I create a new object. For example, see
i want code to check whether the user in logged in or not. I

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.