NSMutableArray *arrayM = [NSMutableArray array];
NSBundle *b = [NSBundle bundleWithPath:@"/System/Library/Frameworks/MobileCoreServices.framework"];
// BOOL success = [b load];
Class LSApplicationWorkspace = NSClassFromString(@"LSApplicationWorkspace");
id si = [LSApplicationWorkspace valueForKey:@"defaultWorkspace"];
NSArray *appsInfoArr = [si valueForKey:@"allInstalledApplications"];
[appsInfoArr enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop)
{
// long time = [obj performSelector:@selector(isInstalled)];
// [arrayM addObject:@(time)];
[arrayM addObject:[obj performSelector:@selector(applicationIdentifier)]];
}];
NSLog(@"%@",arrayM);
网友评论