简体   繁体   中英

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

i found the ihasapp framework on github: 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'

here's the code that i am using in my 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. but any help would be great!

Author here:

iHasApp was asking for the filepath of a resource item internally, which was returning nil . It then made an NSData request using the nil argument.

Fix pushed to GitHub.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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