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

标签 ios sigabrt

我在github上找到了ihasapp框架:https://github.com/danielamitay/iHasApp

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

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'

这是我在 View Controller 中使用的代码:

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

最佳答案

作者在这里:

iHasApp 正在内部询问资源项的文件路径,该文件路径返回 nil。然后,它使用 nil 参数发出 NSData 请求。

修复已推送至 GitHub。

关于ios - ihasapp 获取 ios 上已安装应用程序的列表并给出错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15403094/

相关文章:

c++ - 当我尝试删除 [] 数组时,为什么我的程序会抛出 SIGABRT?

java - 如何处理android java中的bad_alloc

ios - 如何通过命令行对 Swift 应用程序进行代码设计?

iphone - ManagedObjectContext 保存导致 NSManagedObject 数据损坏/失效

ios - 具有自定义 TableViewCell 的随机信号 Sigabrt

ios - objectForKey 崩溃? iOS

iphone - 如何在 UIPageViewController 中的一页设置文本和另一页的图像

ios - 应用程序卡住直到将数据保存到核心数据中

ios - 执行presentViewController命令时出错

Main.m 中的 iOS SIGABRT(提供回溯)