繁体   English   中英

如何从iOS系统上的进程pid获取其他应用程序图标?

[英]How to get other application icon from process pid on iOS system?

我已经看到了这个问题:

如何在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设备上(非越狱的iOS设备)获取NSBundle对象,代码如下:NSBundle * bundle = [NSBundle bundleWithPath:apppath]; 得到捆绑是零。 因此,您无法获取该图标。

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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