Tag: 资源包

安装后从软件包中删除文件

我意识到你不能从iOS包中删除一个项目,因为它是有签名的,但是有没有办法包含一个文件,让它不是“已签名”包的一部分,但是仍然存在于安装中? 用例基本上是安装应用程序,读取文件的内容,存储在钥匙串中,然后删除文件。 感谢您的帮助和指导。 注意 – >应用程序无法访问互联网来获取此文件。 能够删除文件(或擦除文件的内容)一次后,我真的需要。 另外,我们在这里特设分发,我们没有经过任何应用审批stream程。

CoreData:警告:无法为实体“Readings”加载名为“WEEReadings”的类。 找不到类,使用默认的NSManagedObject来代替

好的,现在是社区帮忙几个小时和几个小时的search。 我有一个静态库,使用这个真棒脚本,我生成我的静态框架,其中包括通用静态库,也创build一个包括ReadingsCoreDataModel.momd,其中包括ReadingsCoreDataModel.mom束。 所有好的,我提供这些到我的客户端iOS应用程序,所有构build正确,并启动应用程序扭曲到我的框架和使用捆绑,我有一个单独的WEEDataStore类在我的静态库使用另一个类名为工人,检查,NSManagedObjectModel无,看起来要正确加载,NSPersistentStoreCoordinator不是零,NSManagedObjectContext不是零。 在WEEDataStore中我有一个保存方法,我从我的静态库中的Worker类调用。 在我的ReadingsCoreDataModel.momd中,我创build了一个名称读取和类WEEReadings的实体。 我在Worker类中执行以下操作 WEEReadings* readingsEntity = [NSEntityDescription insertNewObjectForEntityForName:@"Readings" inManagedObjectContext:[[WEEDataStore sharedInstance] managedContext]]; [readingsEntity appendWithReadingsModel:self.readingsModel]; [[WEEDataStore sharedInstance] save]; 结果是得到以下错误 CoreData: warning: Unable to load class named 'WEEReadings' for entity 'Readings'. Class not found, using default NSManagedObject instead. 2014-12-13 20:11:30.080 TestClient[6854:2487108] -[NSManagedObject appendWithReadingsModel:]: unrecognized selector sent to instance 0x1700ccda0 2014-12-13 20:11:30.084 TestClient[6854:2487108] *** Terminating app […]

访问pod中的资源

我想将图片资源包含在cocoapod库中,但是我无法访问它们。 我已阅读这些资源寻求帮助: Cocoapods资源 Cocoapods资源包 Mokacoding资源包 大卫波特资源包 但是,没有人指出我获取资源的方向。 我已经尝试了以下内容: [UIImage imageWithData:[NSData dataWithContentsOfURL:[(NSBundle *)[NSBundle bundleWithIdentifier:@"Assets"] URLForResource:@"my-image@2x" withExtension:@"png"]]] [UIImage imageWithData:[NSData dataWithContentsOfURL:[(NSBundle *)[NSBundle bundleWithIdentifier:@"Assets"] URLForResource:@"my-image" withExtension:@"png"]]] [UIImage imageWithData:[NSData dataWithContentsOfURL:[(NSBundle *)[NSBundle bundleWithIdentifier:@"Assets.bundle"] URLForResource:@"my-image" withExtension:@"png"]]] [UIImage imageWithData:[NSData dataWithContentsOfURL:[(NSBundle *)[NSBundle mainBundle] URLForResource:@"my-image" withExtension:@"png"]]] [[UIImage imageWithData:[NSData dataWithContentsOfURL:[(NSBundle *)[NSBundle mainBundle] URLForResource:@"my-image@2x" withExtension:@"png"]]] [UIImage imageNamed:@"my-asset"] [UIImage imageNamed:@"my-asset@2x.png"] 但是他们都没有工作。 我已经安装了我的podspec这些替代品,既不与上述工作: s.resources = ['Pod/Assets/*.{png, jpg}', 'Pod/Assets/**/*.{png, jpg}'] […]