timestee
timestee

Reputation: 1096

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

I have seen this question:

How to get the current application icon in ios

Now i could get application path from process pid, then according the question above,with the code blow,i could not get the application icon.

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];
}

Upvotes: 2

Views: 1294

Answers (1)

Magic fish
Magic fish

Reputation: 88

You can get the NSBundle object only in a jailbreak iOS, in a non-jailbreak iOS device, the code: NSBundle* bundle = [NSBundle bundleWithPath:apppath]; get the bundle is nil. So, you can not get the icon.

Upvotes: 1

Related Questions