Questions tagged [nsbundle]

An NSBundle object represents a location in the file system that groups code and resources that can be used in a program. NSBundle objects locate program resources, dynamically load and unload executable code, and assist in localization. You build a bundle in Xcode using one of these project types: Application, Framework, plug-ins.

An NSBundle object represents a location in the file system that groups code and resources that can be used in a program. NSBundle objects locate program resources, dynamically load and unload executable code, and assist in localization. You build a bundle in Xcode using one of these project types: Application, Framework, plug-ins.

568 questions
10
votes
5 answers

Can't find .js file in my mainBundle?

This is driving me crazy as I cannot figure out what in the world is going on. I load up files form you main bundle all the time, xml files, html files, etc. But, now I am trying to get the contents of a javascript file but it can never find it. …
Nic Hubbard
  • 41,587
  • 63
  • 251
  • 412
10
votes
5 answers

NSTask launch path not accessible

I am using the following code in my Cocoa project to call a script I made. The script is in the same folder as the project and even shows up under the "Resources" folder in Xcode. The proper path is found, but it still says that the path is not…
hassaanm
  • 14,539
  • 4
  • 21
  • 20
10
votes
1 answer

What's the best way to load an image from a framework in OS X Yosemite (10.10)?

I'm working on a Yosemite app that includes a Notification Center widget (or Today extension). I have a framework where I'm storing all of my shared code and resources, which includes some images. Whether I just use PNGs or an asset catalog, they…
robotspacer
  • 2,732
  • 2
  • 28
  • 50
10
votes
1 answer

settings.bundle ios configure iOS8

I have a problema with iOS8 and the bundle settings, I have a textField where is insert a URL in the settings and use it in my app, but in iOS 8 do not save the text of textField, when I go out of setting and return the textField is in default.…
user2720097
  • 509
  • 5
  • 15
10
votes
5 answers

Multiple Localized .strings Files in iOS App Bundle

I have a fairly complicated project, consisting of several large localized sub-projects. Most of my sub-projects are localized through a single Localizable.strings file. This file is copied into a SubProjectName.bundle target, which is used in…
simeon
  • 4,466
  • 2
  • 38
  • 42
10
votes
3 answers

How do I get an NSArray of filenames of all files in a given directory in my app?

What I want to do seems simple enough: Get an array of filenames in a given "directory" on my app. But the more I play around with NSFileManager and NSBundle I find myself getting more lost...I just want to get the filenames of the files organized…
RexOnRoids
  • 14,002
  • 33
  • 96
  • 136
9
votes
0 answers

NSBundle (not yet loaded)

I'm trying to create an UIImage from an asset (icon). My code is roughly: public class MyModule: NSObject { } let classBundle = NSBundle(forClass: MyModule.self) let bundleURL = classBundle.URLForResource("WeatherUI", withExtension: "bundle") let…
Steve Kuo
  • 61,876
  • 75
  • 195
  • 257
9
votes
1 answer

How do I add an MP3 to my iOS/Xcode project?

I am trying to program an app that includes several songs. Looking through various tutorials they just say to "add your file to the project" or some such so I have tried adding my MP3 to various places (including xcassets) but it is never copied to…
Mark Brittingham
  • 28,545
  • 12
  • 80
  • 110
9
votes
4 answers

iPhone : Get the file path which is within subfolder of Resource folder

I am new to iPhone programming. I want to read the content of a text file located in a subfolder of the Resource folder. The Resource folder structure is the…
Rupesh
  • 7,866
  • 11
  • 41
  • 58
8
votes
1 answer

iPhone - Change bundle identifier

Initially my app's bundle identifier was the default MyCompany.${PRODUCT_NAME:rfc1034identifier} This wasn't matching the app ID I created on the Developer Connection (a space in the product name was being turned into a hyphen) so I hard-coded the…
serverpunk
  • 10,665
  • 15
  • 61
  • 95
8
votes
4 answers

Get fileSize of info.plist to prevent piracy

I'm trying to put anti-piracy code in my app. The previous answer to this (which I can't link to because of my member status - sucks) can be easily countered, since the "SignerIdentity" string can be looked for and replaced in the binary using a hex…
samvermette
  • 40,269
  • 27
  • 112
  • 144
8
votes
2 answers

MonoTouch - How to specify image path of UIImage.FromFile()

I have a path problem with UIImage.FromFile() method. My solution folder has 3 projects and the main UI project has an Images folder in it. I put all my project images in this folder and I have code like this: UIImage myImg =…
DortGen
  • 402
  • 2
  • 8
  • 22
8
votes
1 answer

How to create and check a subdirectory in the Application Bundle

i have create a new subdirectory in my application bundle. This i have done in the xcode environment. target -> copy bundle resources now add a new folder create folder references for any added folders how can i check that the folder is created…
Pinky
  • 131
  • 2
  • 4
8
votes
3 answers

UILocalNotification custom sound

I have been searching for a solution for hours.. with absolutely zero luck. I set up a Local Notification: UILocalNotification *notif = [[cls alloc] init]; [dateComp setDay:j+1]; [dateComp setHour:[[time objectAtIndex:0]…
Mazyod
  • 22,319
  • 10
  • 92
  • 157
8
votes
2 answers

Getting iPhone mainBundle Files

I dont know the exact code i need to retrieve all of the filenames of the resources in my iphone apps mainBundle. if i could have some kind of code like: NSArray *array = [[NSBundle mainBundle] getAllResourceFilenames]; it would be helpful.…
rolling_codes
  • 15,174
  • 22
  • 76
  • 112