Class c =NSClassFromString(@"LSApplicationWorkspace"); id s = [(id)c performSelector:NSSelectorFromString(@"defaultWorkspace")]; NSArray *array = [s performSelector:NSSelectorFromString(@"allInstalledApplications")]; for (id item in array) { NSLog(@"%@",[item performSelector:NSSelectorFromString(@"applicationIdentifier")]); NSLog(@"%@",[item performSelector:NSSelectorFromString(@"bundleIdentifier")]); // NSLog(@"%@",[item performSelector:NSSelectorFromString(@"bundleVersion")]); // NSLog(@"%@",[item performSelector:NSSelectorFromString(@"shortVersionString")]); NSLog(@"%@",[item performSelector:NSSelectorFromString(@"itemName")]); }
时间: 2024-10-14 09:42:17