Is there a way to get the current application icon in a cocoa-touch app? Thank you.
This is how the icons is set inside the info.plist,
//try doing NSLog(@"%@",[[NSBundle mainBundle] infoDictionary]);
CFBundleIcons = {
CFBundlePrimaryIcon = {
CFBundleIconFiles = (
"icon.png",//App icon added by you
"icon@2x.png"//App icon in retina added by you
);
UIPrerenderedIcon = 1;
};
};
If you want to get the app icon use below code:
UIImage *appIcon = [UIImage imageNamed: [[[[[[NSBundle mainBundle] infoDictionary] objectForKey:@"CFBundleIcons"] objectForKey:@"CFBundlePrimaryIcon"] objectForKey:@"CFBundleIconFiles"] objectAtIndex:0]];
P.S: UIImage automatically picks the suitable icon for retina display.
I hope it helps!!