'method' is partial: introduced in macOS 10.8
I'm trying to build some I wrote last year (actually this is code in a library I used last year), and under Xcode 8 I'm getting warnings like these: 'objectForKeyedSubscript:' is partial: introduced in macOS 10.8 'objectForKeyedSubscript:' has been explicitly marked partial here Explicitly redeclare 'objectForKeyedSubscript:' to silence this warning The error occurs with the subscript on names[] below: NSMutableDictionary *names = self.categoryNames; NSMutableOrderedSet *categories = names[cacheKey]; I'm building on 10.12 and targeting 10.11. I don't see how to explicitly redeclare it, since it's on NSMutableDictionary. Do I have to do so in an extension? I don't understand. Why is this even a warning? -- Rick Mann rm...@latencyzero.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: Prioritizing drawing of the important stuff
Hi everyone, Thankyou all for your replies. Plenty of food for thought there - much appreciated. Looks like timers and flow control is the way forward then, if I want to tackle this. I just thought I'd see if there was anything built in to the standard UI frameworks that might be able to help, but it seems not. To answer one of Quincey's comments: >> The low priority thing only really runs when *nothing* else at all is >> happening. > > This shouldn’t be happening, on most Macs. An average desktop Mac has at > least 2 CPU cores (4 logical CPUs), which should allow at least 2 > compute-bound tasks to proceed simultaneously... The reason for this is that the coalescing, post-when-idle NSNotifications I was talking about were being posted to the main queue. Hence all the main queue time was being taken up in ultra-smooth drawing of sliders etc, since that of course also happens on the main queue (UI drawing...). I agree that it looks as if I should bite the bullet and run all this stuff multithreaded. The thing is, a lot of it doesn't fundamentally ~need~ to run multithreaded - one thread should be enough to get drawing responsiveness that I'm pretty happy with, if I could just find a way to control what priorities the different aspects are being treated with. Sounds like timers, flow control and/or multiple threads/queues is the way to go if I want to solve this properly. Cheers Jonny. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to get an undeprecated FSRef
> On 1 Nov 2016, at 15:25, Ken Thomaseswrote: > > On Nov 1, 2016, at 3:20 AM, Gerriet M. Denkmann wrote: >> >> What I really want to do: Create custom icons for folders programmatically. > > Use -[NSWorkspace setIcon:forFile:options:]. > > Regards, > Ken This is hugely better than my old code. Thanks a lot for this suggestion! Kind regards, Gerriet. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to get an undeprecated FSRef
All together, looks like NSWorkspace should enable doing this as long as you don't hit some permissions restrictions on some folders. Less code no doubt too. Cool. > On 1 Nov 2016, at 17:25, Ken Thomaseswrote: > >> On Nov 1, 2016, at 3:20 AM, Gerriet M. Denkmann wrote: >> >> What I really want to do: Create custom icons for folders programmatically. > > Use -[NSWorkspace setIcon:forFile:options:]. > > Regards, > Ken > ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to get an undeprecated FSRef
On Nov 1, 2016, at 3:20 AM, Gerriet M. Denkmannwrote: > > What I really want to do: Create custom icons for folders programmatically. Use -[NSWorkspace setIcon:forFile:options:]. Regards, Ken ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to get an undeprecated FSRef
Hi there, > > What I really want to do: Create custom icons for folders programmatically. > you can use NSWorkspace for that. Check out: https://developer.apple.com/reference/appkit/nsworkspace/1529882-seticon?language=objc ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to get an undeprecated FSRef
> On 1 Nov 2016, at 14:44, Ken Thomaseswrote: > > On Nov 1, 2016, at 2:08 AM, Gerriet M. Denkmann 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( _of_icns_file, ); // this is the only non-deprecated function ResFileRefNum file = FSOpenResFile( _of_new_Icon, fsRdWrPerm ); AddResource( (Handle)hIconFamily, kIconFamilyType, kCustomIconResource, name); CloseResFile( file ); + some FSGetCatalogInfo, FSSetCatalogInfo. finally: FNNotify( , kFNDirectoryModifiedMessage, kNilOptions ); and I would like to convert this code into some non-deprecated form. Kind regards, Gerriet. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to get an undeprecated FSRef
NSWorkspace has iconForFile: NSURL has getResourceValue:forKey:error: Do those not accomplish what you need to do instead? Sent from my iPhone > On 1 Nov 2016, at 16:08, Gerriet M. Denkmannwrote: > > I am using ReadIconFromFSRef (not deprecated), which needs an FSRef. > > How to convert a path into an FSRef without deprecation warnings in macOS 12 ? > > Gerriet. > > > ___ > > Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) > > 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: > https://lists.apple.com/mailman/options/cocoa-dev/dangerwillrobinsondanger%40gmail.com > > This email sent to dangerwillrobinsondan...@gmail.com ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
Re: How to get an undeprecated FSRef
On Nov 1, 2016, at 2:08 AM, Gerriet M. Denkmannwrote: > > 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 ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com
How to get an undeprecated FSRef
I am using ReadIconFromFSRef (not deprecated), which needs an FSRef. How to convert a path into an FSRef without deprecation warnings in macOS 12 ? Gerriet. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) 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: https://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com This email sent to arch...@mail-archive.com