Xcode 4.4 App icon not working - xcode

I was following this tutorial:
http://thenewboston.org/watch.php?cat=28&number=3
It says that there is a resource folder, but here in Xcode 4.4 there is no resource folder. How can I set an icon? I've been trying since 4 hours nothing works.. I've put 57x57 png image file in "Supporting Files" folder as directed by the guy :(
Any help?

Prepare your icon example icon.png 57x57 pixel and icon#2x.png 114x114 pixel for retina display
Open your app, at the left you see Project panel (or set it from menu View > Navigators > Sho Project Navigator), click on name of your Project, at right you see Project and Targets, click on nome in Targets list > Summary tab, in Iphone / iPod deployment Info you see two App Icons box, drag icon.png from folder to first box, and icon#2x.png on second box (for Retina display), you did it!
Files are automatically added to .plist file, infact if you go at Project panel at the left, open Supporting files folder > YourNameApp-Info.plist, you found key Info files (iOS5) > Primary icon > Icon files and Item 0 =icon.png and Item1 = icon#2x.png

Related

Give an OS X app a custom icon?

Yes, my problem really is that simple. How the heck do I get my app to use the icon file or asset catalog?!
System info:
Xcode 6.1.1 (6A2008a)
app target OS X 10.10
OS X 10.10.1 (14B25)
This is my first OS X app but I have several years' experience developing iOS apps.
Steps to reproduce:
open Xcode, start an entirely new cocoa application project
not sure this matters, but i specified my new project not to use storyboards or core data
drag a .png file from my local directory into the project structure, and make sure (a) it ends up in the build target and (b) the file copies into the project's directory
drag the png into the Images.xcassets catalog under any/all of the sizes classes for AppIcon.
build and run
Expected: app in dock and tab-switcher has the new icon.
Actual: app in dock and tab-switcher has the default "blank page with instruments A on it"
Ok, maybe that's a DEBUG thing.
archive the project, show in finder
Expected: app in Finder has correct icon
Actual: nope. It should be noted however that Xcode's Organizer shows the correct icon, and there does exist a file Contents/Resources/AppIcon.icns. Contents/Info.plist specifies that the Icon File is "AppIcon".
grrr. Let's try without the asset catalog.
in the target's General settings, under App Icon, select "don't use asset catalogs"
delete Images.xcassets
In Info.plist, in the line for Icon File (CFBundleIconFile), specify the icon's name (in my case "AppIcon"). The documentation clearly states that
The system looks for the icon file in the main resources directory of the bundle.
File extension is not required here.
build & run. also archive, to save time later.
Expected: app icon in dock and tab-switcher is correct.
Actual: nope
Expected: archived app has correct icon.
Actual: nope, but the archived product did have the correct png file in Contents/Resources.
What am I missing?!
I've tried this with .png app icons and a regular .icns file (generated by Xcode via an asset catalog). I've tried excluding and including the file extension in the Info.plist. Why is this so difficult?
Edit: Clean, Clean Build Folder and deleting the Derived Data folder did not help.
So I found the answer through the help of a commenter: I had to fill all of the xcassets/icns slots with images of the exact dimensions.

Change my app's icon in xcode (OSX app)

I change icon (drag my icon.png to icon place) but when i run my app, in dock doesn't show icon and show default icon
how can i solve this problem
did u make change in the plist file set "Icon file" field value as icon.png
Then clean and build the project
you should make .icns and drag it to your project. you can find information about it from below links:
Creating icns Icon Files
How To: Create Custom Icons for your Mac
How to Make Mac Icons
Try to clean (Product -> Clean) your project and build (Product -> Build) it again.
Also check that all icon files are listed in plist of project.

MacRuby App Icon

I have just written my first "hello world" MacRuby app using XCode. I would like to add a custom application icon. I thought I did this correctly, but when I build my app (using Project > Archive > Application) it builds it with the default Mac Application icon. To import my icon (518 x 518 px PNG), I right-clicked the "App Icon" button and selected the file to copy into my project. I can see the file, but it obviously isn't displaying when I open the app.
What did I do wrong? How can I fix this?
I haven't used MacRuby, but there are two things you have to do to display the right application icon. First, you must convert the PNG file to an icon file. Use the Icon Composer application to convert the PNG file. Icon Composer comes with Xcode. You can find it in the following location:
/Developer/Applications/Utilities
Second, add the icon file to your project. After adding the icon file to your project, you should be able to set the application icon for the project.

How can I set the icon for a Mac Application in Xcode?

I have been learning a lot about writing Objective-C code and designing in Interface Builder and I wanted to set icons for my simple programs.
I added the same JPG to all the size fields in Icon Composer and got an ICNS, but I couldn't figure out how to add it to the project.
Thank you in advance.
Since Xcode 4.4 Icon Composer is no longer the recommended way to create icons and is no longer included in the standard install of Xcode.
Due to the introduction of Macs with retina display, it is now recommended to provide high resolution versions of all graphics including app icons.
To give your app an icon under Xcode > 4.4 do the following:
Create a folder [IconName].iconset in Finder
In this folder place your icon as png files. You'll need the icon in
sizes of 16px, 32px, 64px (retina only), 128px, 256px, 512px and
1024px (retina only)
These icons must be named with the pattern icon_16x16.png,
icon_32x32.png, icon_128x128.png and so on
To support retina displays you must also add icon files with double
resolution, named icon_16x16#2x.png (with size 32x32),
icon_32x32#2x.png (size 64x64) and so on up to icon_512x512#2x.png (size 1024x1024).
drag this [IconName].iconset folder to Xcode (copy if necessary)
in the info.plist file set the "CFBundleIconFile" (Icon File as Key) value to
[IconName] but without the .iconset extension
Annotations:
it is (currently) not required to provide the #2x icons
it will (usually) also work if you don't provide every icon file
the iconset folder should not contain a icon_64x64.png file. the 64px icon is only for the retina version of the icon_32x32
Update:
In the end your .iconset folder has the following 10 items:
icon_16x16.png
icon_16x16#2x.png
icon_32x32.png
icon_32x32#2x.png
icon_128x128.png
icon_128x128#2x.png
icon_256x256.png
icon_256x256#2x.png
icon_512x512.png
icon_512x512#2x.png
Official guide:
https://developer.apple.com/library/content/documentation/GraphicsAnimation/Conceptual/HighResolutionOSX/Optimizing/Optimizing.html
Additional information:
To convert the iconset folder to an icns file, run the following command on the terminal:
iconutil -c icns [IconName].iconset
where [IconName] should be replaced with the prefix of the iconset folder. You now have a file called [IconName].icns. In Xcode 4.4, in the Target Summary, right click the question mark for the icon, then select the icns file. You should then see the question mark get replaced with the icon.
As of Xcode 7 (not sure when this was originally introduced), you can use the Assets.xcassets file for app icons. This file is included by default for new projects.
Simply:
Go to your target's settings and ensure that under General, App Icons the Source is set to AppIcon.
Add all 10 png icons to your Assets.xcassets's AppIcon image.
Delete derived data if you have launched the app before, otherwise it will continue to show the default icon.
Run the app; it should now show your icon in the Dock, Application Switcher, and anywhere else it should appear.
Follow these steps to add an application icon to your project. This is the icon that will be show by the MacOS in the doc bar and alt-tab display.
Create an icon .icns resource file
Place it in the "resources/macos" folder
Add it to the resources group in the xcode project
Edit the Info.plist file and change the "CFBundleIconFile" value string to "icon"
Also, img2icns tool can come handy to convert images to an icon.
It's easy
Use automatic tool (Such as IconFly) for create correct ICNS or iconset with all necessary size.
Then drag and drop created ICNS or iconset to Xcode.
in the info.plist file set the "CFBundleIconFile" value to [IconName]
Steps to add an application icon to your cocoa project.
Find 'Icon Composer' from spotlight.
Drag and drop the icon(name should be like imagename.icns) in the given boxes.
Select one box and save it.
Drag and drop the saved image in the Resources folder of your application.
Select target-->right click on project name-->Select GetInfo.
In Properties enter the name of 'Icon File'.
Now Clean Build and run your application.
Xcode 8.2.1
Convert .png 👉.icns via IconMaker
Add the AwesomeApp.icns file in the same folder as info.plist
Drag AwesomeApp.icns file into xcode in the same folder as info.plist
In info.plist set icon: to AwesomeApp.icns
Step 1: Get iconfile name from info.plist and place icns(icon file) folder in SourceCode/resources folder
Step 2: And same thing goes for xcode,you have to copy all images from xcode using copyallframeworks or copyall resource file in your xcode and build the app again.

Xcode 4 : how to have the folder name of each opened project displayed in the Window menu?

In Xcode 3.x, it was very practical, when you have several Xcode project opened in parallel, to know what is the folder of each project. This info was given in the list of the opened project in the "Window" menu.
It was very useful as it allows to find easily a defined version of a project when you work on several versions in parallel.
How to have the name of the project folders associated to each project displayed in the "Window" menu ?
Is there an option somewhere ?
Thanks a lot.
You could Command-click the file icon next to the title in the window's title bar. This shows the path to the file (in this case the project or workspace file) in any Cocoa app. You can even click one of the entries in the popup menu to open that folder in Finder.

Resources