我在 github 上找到了 ihasapp 框架:https ://github.com/danielamitay/iHasApp
我将这两个文件包含在项目中..但是它给出了一个错误:
2013-03-14 11:21:35.848 应用程序 [4338:2203] * 由于未捕获的异常“NSInvalidArgumentException”而终止应用程序,原因:“* - [NSConcreteData initWithContentsOfFile:options:error:]: nil file argument”
这是我在视图控制器中使用的代码:
#import "helloworldViewController.h"
#import "iHasApp.h"
@interface helloworldViewController ()
@end
@implementation helloworldViewController
- (void)viewDidLoad
{
[super viewDidLoad];
iHasApp *detectionObject = [iHasApp new];
[detectionObject detectAppDictionariesWithIncremental:^(NSArray *appDictionaries) {
NSLog(@"Incremental appDictionaries.count: %i", appDictionaries.count);
} withSuccess:^(NSArray *appDictionaries) {
NSLog(@"Successful appDictionaries.count: %i", appDictionaries.count);
} withFailure:^(NSError *error) {
NSLog(@"Failure: %@", error.localizedDescription);
}];
// Do any additional setup after loading the view, typically from a nib.
}
- (void)didReceiveMemoryWarning
{
[super didReceiveMemoryWarning];
// Dispose of any resources that can be recreated.
}
@end
我对 ios 开发真的很陌生,所以错误可能非常小/愚蠢。但任何帮助都会很棒!