【问题标题】:How to get other application icon from process pid on iOS system?如何从 iOS 系统上的进程 pid 中获取其他应用程序图标?
【发布时间】:2012-04-15 12:08:53
【问题描述】:

我看过这个问题:

How to get the current application icon in ios

现在我可以从进程 pid 获取应用程序路径,然后根据上面的问题,由于代码崩溃,我无法获取应用程序图标。

NSBundle* bundle = [NSBundle bundleWithPath:apppath];
NSArray *infostmp = [[bundle infoDictionary] objectForKey:@"CFBundleIconFiles"];
if(infostmp){
     NSString* iconPath = [[NSString alloc] initWithString:[infostmp objectAtIndex:0]];
     UIImage*  icon =[UIImage imageWithContentsOfFile:iconPath];
}

【问题讨论】:

    标签: ios macos process pid


    【解决方案1】:

    你只能在越狱iOS中获取NSBundle对象,在非越狱iOS设备中,代码:NSBundle* bundle = [NSBundle bundleWithPath:apppath];得到捆绑是零。所以,你不能得到图标。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2014-04-12
      • 1970-01-01
      • 1970-01-01
      • 2011-02-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多