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

  • Home
  • SEARCH
  • 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 8266833
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T05:18:13+00:00 2026-06-08T05:18:13+00:00

When I use NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@sqlite]; The NSBundle class, instead

  • 0

When I use
NSString *path = [[NSBundle mainBundle] pathForResource:name ofType:@"sqlite"];

The NSBundle class, instead of returning nil, for a given file name when the file is not included in Xcode, seems to be creating the file no matter what. I tried removing file from xcode, it did not work, then I went to the path for simulator for the project (that path is generated by pathForResource) :

/Users/USER_NAME/Library/Application
Support/iPhoneSimulator/6.0/Applications/APP_CODE/APP_NAME.app/sampleDB.sqlite

Before I run program in the debugger, I delete file “sampleDB.sqlite” manually. Every time the method pathForResource is called the file seems to magically reappear in the folder.

The documentation states :
Return type :
The full pathname for the resource file or nil if the file could not be located.

EDIT:

With a pathForResource commented out, files removed – I still get that file magically reappearing in the bundle. Any Ideas?

  • 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-08T05:18:14+00:00Added an answer on June 8, 2026 at 5:18 am

    Make a clean build to make sure that the file gets removed from the app bundle.

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

Sidebar

Related Questions

.m coding: -(void)viewDidLoad { NSString *path = [[NSBundle mainBundle] pathForResource:@MathMusic2 ofType:@wav]; self.theAudio = [[AVAudioPlayer
I’m playing a system sound using... NSString *path = [NSString stringWithFormat:@%@%@, [[NSBundle mainBundle] resourcePath],
When I take a path in an NSString and turn around and use it
When reading an NSString from a file I can use initWithContentsOfFile:usedEncoding:error: and it will
I have to use scanf() for accepting name of user in NSString object. If
I want to use a user inputed name in the form of an NSString
Problem : [NSBundle mainBundle] pathForResource returns null (0x0) I read a lot of posts
Consider the 2 following methods of reading a string from a file: NSString *path
My Application is crashes in the device at this point, [[NSBundle mainBundle] pathForResource I
I am doing: NSString *path = [[self class] pathForDocumentWithName:@Alarms.plist]; NSArray *alarmDicts = [NSMutableArray arrayWithContentsOfFile:path];

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.