Questions tagged [mainbundle]

41 questions
1
vote
0 answers

Flag "do-not'backup" files in iOS Main Bundle

I uploaded an app to Appstore but got rejected due to files being backed up to iCloud, when only user generated content should be backed up. The thing is that I have a json in MainBundle that I use only the first time to create and update CoreData.…
user2908787
1
vote
2 answers

Allowed to delete files/folders from Main Bundle resources?

I am designing an app that will come bundled with some audio files. They'll total about 50MB in size. The app will allow you to download other audio files via in-app purchase. My goal is to have all of these files stored in one location (the…
tptcat
  • 3,894
  • 2
  • 32
  • 51
1
vote
2 answers

UIWebView local Resource main bundle html file

I've tried almost every way of loading an html file into an UIWebView that has images and resouces in the main bundle. The web page always loads but I can never get the images to show up. NSString *html = [[NSBundle mainBundle]…
Micaiah Wallace
  • 1,101
  • 10
  • 17
0
votes
3 answers

pathForResource from URL

I have this code: NSString *songPathForm = @"http://www.example.com/file.wav"; NSString *song = [[NSBundle mainBundle]pathForResource:songPathForm ofType:nil]; But song just ends up being null, what am I doing wrong?
Matt
  • 2,920
  • 6
  • 23
  • 33
0
votes
1 answer

How can I save pdf's to my app resources folder, and access them in run-time?

I have an app I'm designing that will allow for lots of PDF viewing. There are a lot of different languages available, and so if I were to include all of them in the app, it would be like 100+ mb in size which just won't fly. So I'm thinking that I…
Stephen J.
  • 3,127
  • 4
  • 20
  • 28
0
votes
0 answers

Resources with identical names in the main bundle

In an iOS app, I happen to have audio resources and it is natural for the use case to call two different resources "001.mp3" and put them in two different folders: Folder_1 and Folder_2. Resulting in: Folder_1/001.mp3 Folder_2/001.mp3 But the…
Michel
  • 10,303
  • 17
  • 82
  • 179
0
votes
0 answers

NSURL from image works fine but not with certificate file

NSURL *imgPath = [[NSBundle mainBundle] URLForResource:@"mycert" withExtension:@"cer"]; The above code works fine with image or other media resources but returns NULL with .cer file! Any help will be highly appreciated.
user804417
  • 155
  • 2
  • 13
0
votes
1 answer

Json file is null when prints in bundle resource ios ionic objective c

I am running an ionic project's ios build app.xcproj in xcode. I am downloading json files from server in the following location: /var/mobile/Containers/Data/Application/63E66EE9-9A1B-4D4D-AEF6-F8C54D159ED0/Library/NoCloud/MyApp/Timing/DTS.json and…
iOS Developer
  • 311
  • 4
  • 25
0
votes
0 answers

Get Nil when retrieving file path form Main Bundle when file is in Copy Bundle

Have spent hours debugging this to no avail. I am trying to add a SKEMitterNode to my scene but when I try to retrieve the path form MainBundle I get: unexpectedly found nil while unwrapping an Optional value I have checked the Copy Bundle and the…
dancingbush
  • 2,131
  • 5
  • 30
  • 66
0
votes
1 answer

Save an image from photo library to Main Bundle in app Xcode

is it possible to save a image I have picked form the photos library to the Main Bundle of my app? I thought I read somewhere that you can't write to the main bundle of an app in Xcode. If this is not true and it is possible how would I go about…
user1114881
  • 731
  • 1
  • 12
  • 25
0
votes
1 answer

Locating custom files in iOS app

I need to place some files in my iOS app initially and with app run copy them to Documents. I placed them to main bundle, but I can not move them. Then I am trying to do it I have an error. I find out that those files are not writable. So how can I…
sffsf
  • 55
  • 5
0
votes
1 answer

Referencing directories within an Xcode project for an iOS app

I need to be able to reference specific files within a directory inside of my xCode project. So far I have this code: let files = NSBundle.mainBundle().pathForResource("sampleFile", ofType: "csv") var contents = String(contentsOfFile: path!,…
Matt Spoon
  • 2,760
  • 5
  • 25
  • 41
0
votes
2 answers

How mainBundle() return on object in swift or objective-c?

I am reading a book related to IOS development. And i am facing a problem when i reading this line let bundle = NSBundle.mainBundle(). The book told that this call returns a bundle object that represents our application. I know, in swift an…
Alamin
  • 877
  • 2
  • 12
  • 17
0
votes
2 answers

Are all the resources of an App Bundle copied to memory (RAM) when an iOS App Launches?

I was wondering if all the resources (images, audios, videos) of an App are copied to memory when an iOS App launches, because if it is so then it wouldn't be necessary loading all the resources at startup to avoid any lags later.
enigma
  • 865
  • 9
  • 22
0
votes
0 answers

files with special characters in the name not accessible in main bundle

I have a number of PDF files within the mainbundle of my iOS app, within my app I access these files to allow the user to select them and attach them to an email. This is my code to get the file url: NSString *pdfFilePath; NSRange…
DevWithZachary
  • 3,545
  • 11
  • 49
  • 101