Re: Sending SIGUSR1 to a process

2024-01-29 Thread Saagar Jha via Cocoa-dev
Yes, this should work. The only changes I know of is that you can’t signal some Apple processes these days if System Integrity Protection is engaged. Saagar Jha > On Jan 28, 2024, at 23:06, Gabriel Zachmann via Cocoa-dev > wrote: > > IIRC, one process cannot send a Unix signal to another

Re: Confusion with app settings / NSUserDefaults

2023-08-16 Thread Saagar Jha via Cocoa-dev
Yes, although in practice I’ve seen the preferences make it to disk fairly quickly after app termination. Saagar Jha > On Aug 15, 2023, at 13:36, Gabriel Zachmann wrote: > > Ah, thanks a lot for the insights! > > Could it happen that the new settings have not been written to disk even if >

Re: Confusion with app settings / NSUserDefaults

2023-08-06 Thread Saagar Jha via Cocoa-dev
The plist file on disk is written to sporadically. cfprefsd is generally the arbiter what the real values are, and it may or may not write things to disk immediately. Conversely, it’s not necessarily sitting around watching the plist file for changes. The correct way to update user defaults in

Re: How do decipher an exception in the log file

2023-07-20 Thread Saagar Jha via Cocoa-dev
Console should have it. That crash log will have the base address in it that you can use to symbolicate things. Saagar Jha > On Jul 18, 2023, at 16:01, Gabriel Zachmann via Cocoa-dev > wrote: > > >> That number is 0x7FFF, which is particularly recognizable and >> happens to be

Re: Memory leak in Apple's image handling frameworks ?

2023-05-01 Thread Saagar Jha via Cocoa-dev
malloc is not the only way for your app to leak memory. CGImage in particular allocates its own anonymous VM regions. footprint against your process (man 1 footprint) is a good way to get a quick look at where the system thinks this memory is going. Once you’ve looked at that, Instruments or

Re: OS/X Java native bug

2023-03-17 Thread Saagar Jha via Cocoa-dev
The implementation of -[ThreadUtilities performOnMainThreadWaiting:block:] does the right thing here, which is calling the block directly if it’s already running on the main thread:

Re: Screensaver Options under macOS 13 (Ventura) doesn't work

2022-11-07 Thread Saagar Jha via Cocoa-dev
I have a couple of custom screensavers where the button works, so it sounds like this must be something with your setup. Perhaps looking at Console might be helpful? Saagar Jha > On Nov 6, 2022, at 13:21, Gabriel Zachmann via Cocoa-dev > wrote: > > I've got a screensaver (sitting in System

Re: Xcode 14 minimum deployment target

2022-10-28 Thread Saagar Jha via Cocoa-dev
I believe Xcode 14 has the old macOS bits (with the new iOS SDK). Try 14.1? > On Oct 28, 2022, at 03:51, Eyal Redler via Cocoa-dev > wrote: > > I read somewhere (can't recall where) that xcode 14 will not support > deployment target < macOS 10.13. > I was bracing myself for having to somehow

Re: Are runtimes of system objects dynamic/SDK dependent/whatever?

2022-06-14 Thread Saagar Jha via Cocoa-dev
Option 2 is pretty much what happens. In addition, the behavior of doCoolStuff might change in 11.0 versus 10.15; the system framework will pick between the two by checking which SDK you were linked against. > On Jun 14, 2022, at 12:30, Aandi Inston via Cocoa-dev > wrote: > > I'm trying to

Re: dispatch_apply() on an NSArray and Thread Sanitizer

2022-04-19 Thread Saagar Jha via Cocoa-dev
If Thread Sanitizer says your code has a race, it almost certainly has a race. Your simple code seems OK superficially, but there are a couple things that could be problematic here: either your real code is actually mutating something, or (unlikely) you are touching some internal state, perhaps

Re: Archive for "Any Mac" automatically ?

2021-08-28 Thread Saagar Jha via Cocoa-dev
This should “just work” if your ARCHS is set to “Standard Architectures” and ONLY_ACTIVE_ARCH is set to NO for the build configuration you use for Archiving (which is probably Release). > On Aug 28, 2021, at 04:44, Gabriel Zachmann via Cocoa-dev > wrote: > > Would it be possible to make

Re: Question about Info.plist's

2020-08-19 Thread Saagar Jha via Cocoa-dev
Which file are you modifying? The one in your source directory? Because the one that goes in the final product doesn’t get copied over until after you’ve lost most control over the build process (it’s done by Xcode after the normal build stages). > On Aug 19, 2020, at 09:58, Owen Hartnett via

Re: Launching in fullscreen gives "Funk" sound sometimes

2020-06-25 Thread Saagar Jha via Cocoa-dev
It’s possible that the “funk” sound is coming from the other app if it still has keyboard focus. Try attaching to that instead and seeing if it hits NSBeep. Saagar Jha > On Jun 25, 2020, at 02:09, Gabriel Zachmann via Cocoa-dev > wrote: > > >> >> Set a symbolic breakpoint on NSBeep and see

Re: Points vs pixels in a bash script

2020-06-10 Thread Saagar Jha via Cocoa-dev
Saagar Jha > On Jun 10, 2020, at 13:52, Ken Thomases via Cocoa-dev > wrote: > > On Jun 9, 2020, at 8:11 AM, Gabriel Zachmann wrote: >> >>> In particular, you're not taking into account the current screen resolution >>> (a.k.a. display mode). The user can select different scaling for a

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-23 Thread Saagar Jha via Cocoa-dev
Saagar Jha > On Apr 23, 2020, at 21:26, Allan Odgaard via Cocoa-dev > wrote: > > On 24 Apr 2020, at 9:57, Rob Petrovec wrote: > >>> Also weird, why would it phone home for a shell script which has neither >>> been stapled nor even code-signed? >> I think you answered the question just then…

Re: Performance issue on macOS 10.15 obtaining display name for ~/Desktop, ~/Documents, and ~/Downloads

2020-04-23 Thread Saagar Jha via Cocoa-dev
I believe that is why you are supposed to staple notarization tickets to your apps. Saagar Jha > On Apr 23, 2020, at 12:12, Gabriel Zachmann via Cocoa-dev > wrote: > >> >> It appears the problem is not with a local service, but that Apple >> actually ?phones home? when a program asks for

Re: Confusion about screen resolution

2020-02-22 Thread Saagar Jha via Cocoa-dev
I believe this became the default with the new MacBook Pros that came out in 2016. Saagar Jha > On Feb 22, 2020, at 09:13, Steve Mills via Cocoa-dev > wrote: > >> On Feb 22, 2020, at 10:04, Richard Charles via Cocoa-dev >> wrote: >> >> This is bizarre. When did this start, Catalina? It

Re: Confusion about screen resolution

2020-02-22 Thread Saagar Jha via Cocoa-dev
No, the default on recent Macs is scaled to slightly under 2x. Saagar Jha > On Feb 22, 2020, at 05:55, Gabriel Zachmann via Cocoa-dev > wrote: > >> >> What have you set in System Preferences > Displays > Resolution. On a Retina >> MacBook most > > I have set it to "Default for display" -

Re: Future of Cocoa

2019-12-16 Thread Saagar Jha via Cocoa-dev
Now that I think about it, you can probably do this without support from the runtime by interposing the handful of runtime functions that invalidate the method cache… Saagar Jha > On Dec 16, 2019, at 00:23, Jean-Daniel wrote: > > My bad, I just see that when rereading the description. Of

Re: Future of Cocoa

2019-12-16 Thread Saagar Jha via Cocoa-dev
There’s also a check for method swizzling and other invalidation, assuming that there is cooperation from the runtime. Unless I’m misunderstanding what you mean by the selector changing? Saagar Jha > On Dec 16, 2019, at 00:16, Jean-Daniel wrote: > > >> Le 16 déc. 2019 à 06:05, Saagar Jha >

Re: Future of Cocoa

2019-11-20 Thread Saagar Jha via Cocoa-dev
Oh, I guess I didn’t explain what I was talking about well. I’m saying that the compiler would do a full method inline but put it behind a check to see if it’s legal to continue executing. For example, code like this: @interface Foo - (void)bar; @end // Another method in some random class -

Re: Future of Cocoa

2019-11-20 Thread Saagar Jha via Cocoa-dev
I am curious why this optimization went in instead of guarded speculative inlining, which would let you keep dynamism. Maybe that was too complicated to implement or didn’t have the right performance characteristics. But I guess this isn’t really the right list for discussing that… Saagar Jha

Re: Thoughts on Objective-C++

2019-11-19 Thread Saagar Jha via Cocoa-dev
Based on the listing, I’d guess UWP. Saagar Jha > On Nov 19, 2019, at 21:18, Richard Charles via Cocoa-dev > wrote: > >> On Nov 13, 2019, at 11:58 AM, Richard Charles wrote: >> >> Apple released iTunes for Windows in October 2003. >> > > > Apple just posted a job opening for a Senior

Re: Future of Cocoa

2019-11-19 Thread Saagar Jha via Cocoa-dev
Saagar Jha > On Nov 19, 2019, at 20:01, Richard Charles via Cocoa-dev > wrote: > > >> On Nov 19, 2019, at 6:24 PM, Pier Bover via Cocoa-dev >> wrote: >> >>> When/if Apple decides to deprecate Cocoa they will announce it many years >>> ahead of time >>> >> >> Like they did with 32 bits

Re: Thoughts on Objective-C++

2019-11-13 Thread Saagar Jha via Cocoa-dev
Saagar Jha > On Nov 13, 2019, at 12:43, Gabriel Zachmann via Cocoa-dev > wrote: > > >> be a good time for a SwiftUI pivot. If true, Cocoa is the new Carbon. >> > > I think, eventually, maybe in 5 years' time, that will be the case. > This is really just a guess, I have no insights into

Re: Thoughts on Cocoa source code

2019-10-11 Thread Saagar Jha via Cocoa-dev
I’m sure much of the Cocoa code is quite old, but it’s mostly all Objective-C. If you’re curious how it might work, but don’t want to use a disassembler, the GNUstep project has a somewhat decent (though incomplete) reimplementation that you can look at.

Re: Thoughts on Cocoa source code

2019-10-09 Thread Saagar Jha via Cocoa-dev
Nothing is statically linked. The version of the SDK you compile with is embedded into your application and Cocoa (and other Apple frameworks) consult this at runtime to determine appropriate behavior. Often this means you don’t get the new behavior, but sometimes Apple will automatically “opt

Re: Thoughts on Cocoa source code

2019-10-09 Thread Saagar Jha via Cocoa-dev
Saagar Jha > On Oct 9, 2019, at 10:19, Turtle Creek Software via Cocoa-dev > wrote: > > Why is Cocoa source code hidden? > > Many of the frustrations we had with the 64-bit update attempt were caused > by Cocoa's lack of visible source. It was a "black box" that often required >

Re: Why is / a metachar in regular expressions ?

2019-09-18 Thread Saagar Jha via Cocoa-dev
If you need any more confirmation, Swift’s NSRegularExpression escapes this exact set of characters , so there isn’t an error in the

Re: 10.15 command line tools headers missing

2019-09-13 Thread Saagar Jha via Cocoa-dev
FWIW, the Command Line Tools (which is significantly smaller than Xcode) includes the headers (at /Library/Developer/CommandLineTools/SDKs/MacOSX.sdk/usr/include/), and will also set Clang’s default header search path so that these can be found. You can get that with “xcode-select --install”,

Re: ARC

2019-08-27 Thread Saagar Jha via Cocoa-dev
I highly doubt that setting a breakpoint on objc_retain would be useful: it’s called too often. Just launching Calculator, for example, hits the function over 20 times, so even a conditional breakpoint would make execution prohibitively slow. I would expect you to have more luck finding