Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7890685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 3, 20262026-06-03T06:25:12+00:00 2026-06-03T06:25:12+00:00

My program for MacOS is creating the alias to another file and I want

  • 0

My program for MacOS is creating the alias to another file and I want this alias to have some designated icon. How can I do it with Objective-C, preferably in Cocoa?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-03T06:25:13+00:00Added an answer on June 3, 2026 at 6:25 am

    You can use NSWorkspace, which has a method for doing this:

    //anImage is an NSImage object and
    //pathToFile is a path string
    [[NSWorkspace sharedWorkspace] setIcon:anImage forFile:pathToFile options:0];
    

    This will save the icon data to the file’s Resource Fork. These days Mac OS doesn’t use actual resource forks, so the image is stored in an HFS extended attribute named com.apple.ResourceFork.

    Extended attributes are filesystem metadata attached to a file. You can see the extended attributes attached to a file using xattr and related commands.

    Note that extended attributes are only guaranteed to be reliable on HFS+ file systems, if the file is located on a file server that doesn’t support file metadata or on an external drive with a non-HFS file system, the icon may not be written.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i have some problems with linking nasm program for macos: GLOBAL _start SEGMENT .text
I have a program written in C that runs on Linux, MacOS and Windows.
I have a server program that I am writing. In this program, I log
I have a program that runs fine on MacOS and Linux and cross-compiles to
My program receives an executable binary file through a TCP socket. I need to
This program int main() { int a, b; a = b; return 0; }
I program on Eclipse for Android. But I have a problem with the Android
My program gives this error under gdb: During startup program exited with code 0xc0000135.
I'm new to the world of iOS programming and MacOS at all, and this
I have a Java SWT program on Mac OS X that always shows 'java'

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.