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
0
votes
1 answer

localNotification.soundName from cache

is it possible to assign a soundname for localNotification from the device cache? I've tried to assign an existing file from the application bundle and it worked properly. My app will record a soundfile what should work as…
0
votes
1 answer

NSBundles loaded during runtime don't give resource paths

i'm programming an app with cocoa that installs additional NSBundles during runtime. But i can't get any resources out of it. That's the code so far: -(void)load { NSString *appSupportSubpath = [[NSBundle mainBundle] builtInPlugInsPath]; …
thomasguenzel
  • 670
  • 7
  • 25
0
votes
1 answer

How do you use NSBundle pathForResource without autorelease pool?

What is the non-autorelease equivalent of this code? NSString *nsFName = [[NSBundle mainBundle] pathForResource:nsName ofType:nsExt inDirectory:nsPath];
CuriousGeorge
  • 7,120
  • 6
  • 42
  • 74
0
votes
1 answer

NSBundle instance method URLForResource:withExtension returning invalid CFStringRef on device

I make the following method call in my code: NSURL *modelURL = [[NSBundle mainBundle] URLForResource:@"myappname" withExtension:@"momd"]; When I run on the simulator, this returns an NSURL that works. When I run on my device, it returns an invalid…
Darren
  • 10,091
  • 18
  • 65
  • 108
0
votes
2 answers

NSBundle Not Working

NSBundle outputs the old name of my app: "/var/mobile/Applications/0E1638D2-5B9C-4A1F-8ED2-5F8ADF55D3F6/distributedLCA.app" but I renamed the project but it still prints out that old .app name. Is there a way to fix this? My code: [[NSBundle…
MrHappyAsthma
  • 6,332
  • 9
  • 48
  • 78
0
votes
2 answers

Improving text file reading speed in Xcode?

I'm currently working on a project that involves a lot of text file reading. I need to get the contents of the files into NSStrings so I can go and manipulate them further. What I'm using: NSString *file = [[NSBundle mainBundle]…
flickMik
  • 27
  • 3
-1
votes
1 answer

NSTask in NSBundle

I am calculating total number of file on particular path and showing that result in custom cell. I am using NSThread for calculating file count in - (void)drawWithFrame:(NSRect)cellFrame inView:(NSView*)controlView(inside the bundle) method. when i…
Parag Bafna
  • 22,812
  • 8
  • 71
  • 144
-1
votes
1 answer

Thread 1: "Could not load NIB in bundle: 'NSBundle (loaded)' with name 'SleepThreeCollectionViewCell'"

I am receiving this error and I checked every answer there is online on how to solve this and it does not work for me. I tried cleaning the build folder, I do not have a xib file, reuploading the collectionviewcell file, and I have all of the…
-1
votes
2 answers

IOS: check a plist file

I have this code: for the simulator to write a NSmutableArray in a plist NSString *path = [[NSBundle mainBundle] pathForResource: @"Array" ofType:@"plist"]; if([Array writeToFile:path atomically: YES]){ NSLog(@"write succesful");} else { …
cyclingIsBetter
  • 17,447
  • 50
  • 156
  • 241
-1
votes
2 answers

present() method throws 'Could not load NIB in bundle: 'NSBundle

Using xCode 8 I created two TableViewControllers. I am trying to pass data from the selected cell in one TableViewController to the second. override func tableView(_ tableView: UITableView, didSelectRowAt indexPath: IndexPath){ let…
D. Charlton
  • 13
  • 1
  • 2
-1
votes
2 answers

Retrieving data from property lists

I have a plist data, contains an array of dictionaries, and I want to get all the dictionaries first value which's english let path = Bundle.main.path(forResource:"idictionary", ofType: "plist") let plistData = NSArray(contentsOfFile:…
Sarmand Amer
  • 9
  • 1
  • 6
-1
votes
2 answers

Swift 2.0 : NSBundle always returns nil

I'm implementing this git - NSDate-TimeAgo It has swift extension inside. I have dragged and drop the Bundle that the git supply into my app - NSDateTimeAgo.bundle In the extension file im trying to get this file path , but it always return…
Roi Mulia
  • 5,626
  • 11
  • 54
  • 105
-1
votes
2 answers

Iphone SDK: pathFoResource:Nsstring problem -> playin MP3 files

I am trying to get 10 mp3 files in the resources folder and play them when a button is pressed. I have entered name of the mp3 files in a NSMutableArray and read each one after the button is pressed. The problem is that pathForResource: is not…
Kaya
  • 1
-1
votes
4 answers

How To Read Images From NSMainBundle in iOS

I have the structure like the following in my Xcode project. I need to read all the images from project and need to store it in array. I have used the following code from some other StackOverflow posts, but it's not working. NSFileManager…
Peer Mohamed Thabib
  • 636
  • 2
  • 9
  • 29
-1
votes
1 answer

Component bundles

I'd like to create components which have a similar structure (all of them having a controller class, a XIB file and language resources). I've figured I could use bundles for this purpose. However, it seems there are some limitations on iOS (for…
Janos
  • 1,987
  • 3
  • 17
  • 24
1 2 3
37
38