ihasapp获取ios上安装的应用程序列表给出错误

时间:2013-03-14 07:01:25

标签: ios sigabrt

我在github上发现了ihasapp框架:https://github.com/danielamitay/iHasApp

我将两个文件包含在项目中......但是它给出了一个错误:

  

2013-03-14 11:21:35.848 apps [4338:2203] *终止应用   未捕获的异常'NSInvalidArgumentException',原因:'*    - [NSConcreteData initWithContentsOfFile:options:error:]:nil file argument'

这是我在viewcontroller中使用的代码:

#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开发的新手,所以错误可能非常小/愚蠢。但任何帮助都会很棒!

1 个答案:

答案 0 :(得分:1)

作者:

iHasApp在内部要求提供资源项的文件路径,并返回nil。然后,它使用NSData参数发出了nil请求。

修复推送到GitHub。