Questions tagged [mainbundle]
41 questions
0
votes
1 answer
Saving images to Main Bundle and then loading them into HTML works on Simulator, but not on real Device?
I'm trying to preload the image tags from an html string in order to load them when the device is offline. Basically, I strip the source url from all the
tags, clean the url to have a clean filename, then download the image.
__block …

George Cc
- 5
- 1
- 4
0
votes
0 answers
iOS - Reading from a txt file
I am storing level details inside of a text file within my iOS project. The Text File contains the following:
Level1.txt
LevelNum:1.0
weaponPickupRate:10.0
weaponPickupAmount:20
monsterMinSpeed:8.0
monsterMaxSpeed:12.0
…

Ryann786
- 289
- 4
- 12
0
votes
1 answer
can't get url to work in swift
var url :NSURL = NSURL(fileURLWithPath: NSBundle.mainBundle().pathForResource("MTNSoundTrack", ofType: "aif")!)!
The name of my file and the type are double checked, but still it does not work I'm trying to play a background song in swift spriteKit

Eduardo Rojas Alva
- 33
- 4
0
votes
1 answer
Can not load file using [[NSBundle mainBundle] pathForResource ofType inDirectory]
I have a directory with a website I need to add to my project. I will load it using a uiwebview.
I've tried several ways of adding it, all unsuccessful. This is the last way I tried:
Copied the whole website directory to my project directory (the…

Avba
- 14,822
- 20
- 92
- 192
0
votes
2 answers
pathForResource ofType returns nil
here is the code i am working with.
NSString* path = [[NSBundle mainBundle] pathForResource:@"file" ofType:@"plist"];
if(path == nil)
{
NSLog(@"file not found");
}
when i run this it prints file not found in the console.
my file.plist is in the…

Joshua Blevins
- 689
- 1
- 10
- 27
0
votes
1 answer
Loading NIB makes status bar become completely black, and remains black
My opening screen (my main app screen) is a UIView where everything is done programatically. I wanted to use an XIB for my "settings" screen, but I am getting a strange completely black bar at the top over the status bar:
I switch to it as…

Narwhal
- 744
- 1
- 8
- 22
0
votes
2 answers
Is it possible to copy file to Main bundle?
I want to copy file(image,mp3...) from main bundle to main bundle. To use
[[NSBundle mainBundle]pathForResource:@"copyname" ofType:@"mp3"]
from path = /var/mobile/Applications/62734FAF-1E94-4792-9978-exam/myproject.app/file.mp3
to path =…

Sean
- 29
- 1
- 6
0
votes
2 answers
texture atlas file not found in main bundle in resources folder
I'm having a problem where a file in my Resource directory is not being recognized as being in the Main Bundle.
I am creating a texture atlas using a pvr file format using texturePacker. The output of texturePacker produces two files…

JeffB6688
- 3,782
- 5
- 38
- 58
0
votes
1 answer
Is that possible to make main bundle writable in IOS?
NSString *path = [[[NSBundle mainBundle] bundlePath] stringByAppendingPathComponent:@"favorites.plist"];
BOOL canWrite = [arr writeToFile:path atomically:YES];// arr is an NSArray
I got canWrite = NO. Did some research which says that the main…

Hao Liu
- 45
- 6
0
votes
2 answers
Copy file to documents directory (sandbox) from main bundle
I need to copy some png to documents folder from the main bundle at the first run of my app. I need it because I have to save the file path of these images in a core data entity.
I tried in that way, but it don't works, anybody knows why?
// to…

Totka
- 627
- 6
- 24
0
votes
1 answer
How to extract immages from a folder in the mainBundle to an array?
In my app bundle, I have several images of several…

Tom Tallak Solbu
- 559
- 6
- 20