nsbundle

Load view from NIB file from several different UIViewControllers

Hello, I have been loading view from Nib files successfully using the approach found on this site [[NSBundle mainBundle] loadNibNamed:@"YourNibName" owner:self options:nil]; The problem is that, because we have to set the File Owner, this nib file becomes "attached" to this view controller. This view is subclass of UITableViewCell an...

NSBundle returns nil

Hi, I wanted to read version information of my application from the plit file. For this I am using a code as shown below. NSString *myFilePath = [[NSBundle mainBundle] pathForResource:@"MyApp-Info" ofType:@"plist"]; // Format output NSLog(@"%@",myFilePa...

NSBundle pathForResource is NULL

Hi, I'm creating a simple application with xcode and objc and I need to load an NSDictionary from a file, but I can't get the path to the file using NSBundle: NSString *l = [[NSBundle mainBundle] pathForResource:@"LoginStatuses" ofType:@"plist"]; NSLog(@"%@", l); When I run this code I get this: 2010-10-16 10:42:42.42 Sample[5226:a0f...

What exactly is NSBundle useful for - only to access resources of the .app package?

...or could I also get an NSBundle that represents the Documents directory, to easily access contents in there? ...

Loading pdf file from Resource directory in iphone crashes

NSURL *pdfURL = [[NSBundle mainBundle] URLForResource:@"sampleLayout.pdf" withExtension:nil]; this above line warns NSBundle may not respond to -URLForResource:withExtension: and the app crashes while loading the pdf file from this url path ...

Get image paths from NSBundle in Objective C?

I have about 60 images I want to store in Core Data, 30 of which are avatars and have the prefix of avt_filename_00X.png and 30 of them are smaller and have a different prefix. Rather than storing all the images as BLOBs in Core Data/SQLite, I want to store the paths for each image found (in the same way you would store image paths for ...

iphone copying folder from bundle to documents

I'm having the hardest time getting this to work. I'm trying to copy a folder from my bundle to the documents directory. the folder I'm trying to find is here: ...app/Resources/12/(a bunch of jpgs) NSString *myPath = [[[NSBundle mainBundle] resourcePath]stringByAppendingPathComponent:@"12"]; NSLog(@"%@",myPath);/// returns "..../MyApp...

Acess files with the same name in Sub-Subdirectories

First my structure: Application |---> dirA |---> dirB |---> index.html |---> somefile.js |---> dirC |---> index.html |---> somefile.js |---> dirD |---> index.html |---> somefile.js some problems here. i need to load the index.html of this different dirs in my webview. but ...