• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How to get an undeprecated FSRef
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to get an undeprecated FSRef


  • Subject: Re: How to get an undeprecated FSRef
  • From: "Gerriet M. Denkmann" <email@hidden>
  • Date: Tue, 01 Nov 2016 15:20:28 +0700

> On 1 Nov 2016, at 14:44, Ken Thomases <email@hidden> wrote:
>
> On Nov 1, 2016, at 2:08 AM, Gerriet M. Denkmann <email@hidden> wrote:
>>
>> I am using ReadIconFromFSRef (not deprecated), which needs an FSRef.
>>
>> How to convert a path into an FSRef without deprecation warnings in macOS 12 ?
>
> I doubt you'll find anything.  You should switch to using NSImage and -initWithContentsOfURL: (or -initWithContentsOfFile:).
>
> Regards,
> Ken

What I really want to do: Create custom icons for folders programmatically.

I have some old code (still working, but very much deprecated) like:

IconFamilyHandle hIconFamily;
ReadIconFromFSRef( &fsRef_of_icns_file, &hIconFamily ); // this is the only non-deprecated function

ResFileRefNum file = FSOpenResFile( &fsRef_of_new_Icon, fsRdWrPerm );
AddResource( (Handle)hIconFamily, kIconFamilyType, kCustomIconResource, name);
CloseResFile( file );

+ some FSGetCatalogInfo, FSSetCatalogInfo.

finally:
FNNotify( &targetFolderFSRef, kFNDirectoryModifiedMessage, kNilOptions );

and I would like to convert this code into some non-deprecated form.


Kind regards,

Gerriet.


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden


  • Follow-Ups:
    • Re: How to get an undeprecated FSRef
      • From: Ken Thomases <email@hidden>
    • Re: How to get an undeprecated FSRef
      • From: Tamas Nagy <email@hidden>
References: 
 >How to get an undeprecated FSRef (From: "Gerriet M. Denkmann" <email@hidden>)
 >Re: How to get an undeprecated FSRef (From: Ken Thomases <email@hidden>)

  • Prev by Date: Re: How to get an undeprecated FSRef
  • Next by Date: Re: How to get an undeprecated FSRef
  • Previous by thread: Re: How to get an undeprecated FSRef
  • Next by thread: Re: How to get an undeprecated FSRef
  • Index(es):
    • Date
    • Thread