0

可能重复:
获取所有已安装应用程序的列表

我正在寻找应用程序控制系统工具,其中我想要一个所有已安装应用程序名称的列表,并且用户将允许更改那里的状态,即用户可以从跳板中隐藏这些。如果可以,那有可能吗?请帮帮我?

4

1 回答 1

2

尝试这个

-(NSArray *) installedApps
{
    BOOL isDir enter code here= NO;
    NSDictionary *cacheDienter code herect;
    NSDictionary *user;
    static NSString *const cacheFileName = @"com.apple.mobile.installation.plist";
    NSString *relativeCachePath = [[@"Library" stringByAppendingPathComponent: @"Caches"] stringByAppendingPathComponent: cacheFileName];
    NSString *path = [[NSHomeDirectory() stringByAppendingPathComponent: @"../.."] stringByAppendingPathComponent: relativeCachePath];
    if ([[NSFileManager defaultManager] fileExistsAtPath: path isDirectory: &isDir] && !isDir) // Ensure that file exists
    {
        cacheDict    = [NSDictionary dictionaryWithContentsOfFile: path];
        user = [cacheDict objectForKey: @"System"]; // Then all the user (App Store /var/mobile/Applications) apps
    }



    //NSLog(@"Installed Applications = %@",[user allKeys]); 
    //return [user allKeys];
    return nil;
}

这将为您提供一系列已安装的应用程序。

这个链接也可以帮助你链接

于 2013-01-16T10:14:58.530 回答