【发布时间】: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];
}
【问题讨论】: