简体   繁体   English

ihasapp获取ios上已安装应用的列表,并给出错误

[英]ihasapp to get list of installed apps on ios giving an error

i found the ihasapp framework on github: https://github.com/danielamitay/iHasApp 我在github上找到了ihasapp框架: https : //github.com/danielamitay/iHasApp

i included the two files into the project..however it is giving an error: 我将这两个文件包含到项目中。但是它给出了一个错误:

2013-03-14 11:21:35.848 apps[4338:2203] * Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '* -[NSConcreteData initWithContentsOfFile:options:error:]: nil file argument' 2013-03-14 11:21:35.848 apps [4338:2203] *由于未捕获的异常“ NSInvalidArgumentException”而终止应用程序,原因:“ * -[NSConcreteData initWithContentsOfFile:options:error:]:无文件参数”

here's the code that i am using in my viewcontroller: 这是我在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

i am really new to ios development so the error might be very minor/silly. 我真的是ios开发的新手,所以错误可能很小/很傻。 but any help would be great! 但是任何帮助都会很棒!

Author here: 作者在这里:

iHasApp was asking for the filepath of a resource item internally, which was returning nil . iHasApp正在内部请求资源项的文件路径,该路径返回nil It then made an NSData request using the nil argument. 然后,使用nil参数发出了NSData请求。

Fix pushed to GitHub. 修复已推送到GitHub。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM