Re: How to convert path through container into standard form?

2022-12-11 Thread Mike Abdullah via Cocoa-dev
Have you tried -URLByResolvingSymlinksInPath? As far as I’m aware, the Pictures entry inside your container is a symlink to the real thing, so assuming you have appropriate entitlements, should be possible to resolve it. Mike. > On 11 Dec 2022, at 10:56, Gabriel Zachmann via Cocoa-dev > wrote

Re: Retrieving the EXIF date/time from 250k images

2022-08-18 Thread Mike Abdullah via Cocoa-dev
It’s not a very good fit, but when you say a “GCD concurrent queue”, you’d need to be more specific. There are several configs possible. Do you mean a global queue, or one you made yourself? If you made it yourself, how did you configure it? The tricky problem is that GCD aims to optimise CPU u

Re: Problem with rangeOfString and Umlauts

2022-03-12 Thread Mike Abdullah via Cocoa-dev
Perhaps worth noting that the docs for commonPrefixWithString:options: cover cases like this: > Discussion > The returned string is based on the characters of the receiver. For example, > if the receiver is “Ma¨dchen” and aString is “Mädchenschule”, the string > returned is “Ma¨dchen”, not “Mäd

Re: iOS UINavigation background removal.

2022-01-28 Thread Mike Abdullah via Cocoa-dev
If I remember correctly from doing something like this in the path, the important thing in the below code is you are providing a custom image for the nav bar to draw as its background, instead of doing a blur effect. The image you supply happens to be empty so nothing is drawn in the end, and yo

Re: Multiple shadows in iOS on a view.

2021-06-11 Thread Mike Abdullah via Cocoa-dev
Your description seems a bit confused here. Why declare the applySketchShadow() method but never use it? The force conversion of UIBezierPath to CGPath smells, and suggests you never hit this code path. If so, I think you may have layers with no content and no path, so will not generate a shado

Re: Simplest way to produce "tick" system sound?

2021-06-11 Thread Mike Abdullah via Cocoa-dev
NSBeep() ? Mike. Sent from my iPhone > On 11 Jun 2021, at 13:59, Gabriel Zachmann via Cocoa-dev > wrote: > > Sorry for the stupid question: > what would be the easiest way to produce that "tick" system sound > signifying an invalid keyboard input? > I am talking about the new system sound un

Re: How do you handle reading a plist if it may be an array or a dictionary?

2021-05-10 Thread Mike Abdullah via Cocoa-dev
> On 10 May 2021, at 10:52, Mark Allan via Cocoa-dev > wrote: > > Hi, > > Now that Alex has the answer to his problem, can I ask a follow-up question > based on this line in his initial email? > >> On 9 May 2021, at 1:12 am, Alex Zavatone via Cocoa-dev >> wrote: >> _configurationDic

Re: How do you handle reading a plist if it may be an array or a dictionary?

2021-05-10 Thread Mike Abdullah via Cocoa-dev
Further to earlier answers, it’s worth pointing out you’ve got an anti-pattern in this code. You go: 1. Check if file exists 2. Try to read file There is no point to step 1. Just do step 2 directly, and handle failure there. If you _don’t_ handle failure at step 2, you’ve got yourself a nasty l

Re: Several different NSUserDefaults in the same app?

2021-04-04 Thread Mike Abdullah via Cocoa-dev
> On 3 Apr 2021, at 16:34, Richard Charles via Cocoa-dev > wrote: > >> >> On Apr 3, 2021, at 8:59 AM, Gabriel Zachmann wrote: >> >> Thanks a lot for your response! >> >>> How about something like this? >>> >>> NSUserDefaults *monitor1 = [[NSUserDefaults alloc] init]; >>> [monitor1 set

Re: Exception not being caught in try statement

2021-03-26 Thread Mike Abdullah via Cocoa-dev
This does seem quite surprising. However, here’s the thing: this code is very strange approach to take. Number 1: Cocoa doesn’t support exceptions as an error-handling mechanism except where explicitly stated and supported. You’re trying to use them, which is asking for trouble. The system does

Re: Throttling drawing to vertical refresh

2020-10-15 Thread Mike Abdullah via Cocoa-dev
CADisplayLink Mike. Sent from my iPhone > On 15 Oct 2020, at 20:13, Andreas Falkenhahn via Cocoa-dev > wrote: > > I'm drawing inside an NSView by simply setting its layer's contents to a > CGImage which is updated for every frame, e.g. something like this: > >dp = CGDataProviderCreateW

Re: Invalidating UIImageView's image cache

2020-09-23 Thread Mike Abdullah via Cocoa-dev
Correct, this is your issue. Have a read of the docs on +[UIImage imageNamed:] They explicitly discuss the cache. This is not the API you want. Mike. > On 23 Sep 2020, at 02:12, Eric Lee via Cocoa-dev > wrote: > > Ah maybe it is the use of `imageNamed:`. I believe that caches the image >

Re: Thoughts on Objective-C++

2019-11-13 Thread Mike Abdullah via Cocoa-dev
> On 13 Nov 2019, at 19:31, Turtle Creek Software via Cocoa-dev > wrote: > > I made a rather bold statement about Cocoa being doomed. Here's some > background on where it came from. > > Apple and Microsoft are both working on next-generation app development > platforms, with the goal of havi

Re: Questions regarding release

2019-09-27 Thread Mike Abdullah via Cocoa-dev
> On 27 Sep 2019, at 00:43, James Walker via Cocoa-dev > wrote: > > On 9/26/19 4:20 PM, Gabriel Zachmann via Cocoa-dev wrote: >>> The issue in the below code to my eye is that you allocate a path with >>> CGPathCreateWithRect (+1) but then don't release it. >>> >>> In that case, I am wonderi

Re: Questions regarding release

2019-09-26 Thread Mike Abdullah via Cocoa-dev
I don’t believe that’s entirely true. “make” methods return a +0 value. The issue in the below code to my eye is that you allocate a path with CGPathCreateWithRect (+1) but then don't release it. Mike. > On 26 Sep 2019, at 17:16, Glenn L. Austin via Cocoa-dev > wrote: > > The analyzer is gre

Re: Cocoa-dev Digest, Vol 16, Issue 87

2019-09-17 Thread Mike Abdullah via Cocoa-dev
> On 17 Sep 2019, at 09:04, Gabriel Zachmann via Cocoa-dev > wrote: > >> >> The bounds origin is the origin of the coordinate system for sublayers of >> that layer, and thus changing the bounds origin moves sublayers around. > > Thanks a lot for the insight. > > Just out of curiosity (or f