nsbundle

Need to make a DLC “packet” system for my iOS game

折月煮酒 提交于 2019-12-07 22:30:28
I'm developing a game for iOS and I need to make a system to download "packs" after the player bought them with In App Purchases. I've search on the internet for a method like using a bundle, or just using web services, but I really don't know which one is the best. Let me be specific: in one pack the player has between 1-3 sprites, 1-2 music files, and 1-3 backgrounds. So what I need to do is download that "pack" and store it as "purchased". What methods would be the most reusable and modular? By far the easiest and most simple solution would be to bundle the DLC in to your app with an update

'Could not find a storyboard named 'MainTabController' in bundle NSBundle

一笑奈何 提交于 2019-12-07 16:26:53
问题 the error I'm receiving that I can't seem to fix is Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainTabController' in bundle NSBundle the app will build and the login screen will display but crashes immediately after with the error stated above. I have tried all of the following from other post similar to this and have had no luck. Removing the reference to the storyboard in the info.plist file. When I do this the app

Frameworks vs. Bundles

纵然是瞬间 提交于 2019-12-07 05:51:51
问题 I want to be able to add plugins for an application I am developing and as it is a development tool I want other people to be able to write their own plugins. So my questions are what are the real differences between a framework and a loadable bundle? Which are more suited to being a plugin(accessing of headers, ect) ? And if I use loadable bundles how do I load them at runtime and access their functionality during development? The plugins should not have to rely on other plugins. 回答1: Have

iPhone - Change bundle identifier

半世苍凉 提交于 2019-12-06 22:27:41
问题 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 bundle identifier in MyApp-Info.plist to be com.MyCompany.MyApp However, when I log [NSBundle mainBundle] bundleIdentifier] it's still returning the old identifier. Cleaning the targets did not help. Can anyone think of where this is coming from, if

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

回眸只為那壹抹淺笑 提交于 2019-12-06 20:17:21
问题 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 in a specific directory in my iPhone Xcode project...For example: The directory in question is called "Images" (created using "Add > New Group" under the project icon in Xcode) and contains 10 .png images. It seems simple but I am getting nowhere. I

Cocoa - problem with this code using NSBundle

亡梦爱人 提交于 2019-12-06 16:17:54
问题 It was suggested that I use this line of code to call an image from my resources folder/project bundle. I also see it being used exactly like this on many different website tutorials. NSBundle *mb=[NSBundle mainBundle]; NSString *fp=[mb pathForResource:@"topimage" ofType:@"PNG"]; NSImage *image=[NSImage initWithContentsOfFile:fp]; HOWEVER, I am receiving the following warning: NSImage may not respond to +initWithContentsOfFile+ The documentation for NSImage shows that initWithContentsOfFile

load local image into UIWebView

半腔热情 提交于 2019-12-06 14:42:49
问题 I want to take a screenshot and then send to webview a local path for it, so it will show it. I know that webview could take images from NSBundle but this screenshots are created dynamically - can I add something to it by code? I was trying it like this: UIGraphicsBeginImageContext( webView.bounds.size); [self.view.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); NSString *file = @"myfile.png";

Accessing images from nsbundle

*爱你&永不变心* 提交于 2019-12-06 14:36:14
I have a framework which is trying to access xib's and images from a bundle. I am able to access the xib fine but unable to load the images in UIImageView. I even check if the file exists and the console output is yes... Any idea how to load the image? Code to load xib in the framework viewcontroller file self = [super initWithNibName:@"ViewController_iPad" bundle:[NSBundle bundleWithPath:[[NSBundle mainBundle] pathForResource:@"MyBundle" ofType:@"bundle"]]]; Code to load images - (void) loadImage { NSString *path = [[NSBundle mainBundle] pathForResource:@"MyBundle.bundle/test" ofType:@"png"];

Communication between Main Application and loadable bundle

一笑奈何 提交于 2019-12-06 11:33:46
问题 OK, it's rather self-explanatory. Let's say we've got our cocoa application. Let's all assume that you've already got some "plugins", packaged as independent loadable bundles. This is how bundles are currently being loaded (given that the plugin's "principal class" is actually an NSWindowController subclass : // Load the bundle NSString* bundlePath = [[NSBundle mainBundle] pathForResource:@"BundlePlugin" ofType:@"bundle"] NSBundle* b = [NSBundle bundleWithPath:bundlePath]; NSError* err = nil;

'Could not find a storyboard named 'MainTabController' in bundle NSBundle

落花浮王杯 提交于 2019-12-06 03:48:21
the error I'm receiving that I can't seem to fix is Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'Could not find a storyboard named 'MainTabController' in bundle NSBundle the app will build and the login screen will display but crashes immediately after with the error stated above. I have tried all of the following from other post similar to this and have had no luck. Removing the reference to the storyboard in the info.plist file. When I do this the app does start but I get a black screen as it doesn't load the storyboard. Fiddle with the Target Membership