No, oddly enough I still get 3: No such process. What does this mean, exactly?
Error 3 is almost certainly
ESRCH
, which sounds very much like some OS subsystem is reusing a POSIX-style error code for something that’s not really a POSIX error.
I have tried adding
LSRegisterURL
directly before, and it succeeds.
As this is the first time you mentioned
LSRegisterURL
, I’m not sure how to parse that sentence. My best guess is that:
If you take
My2.app
out of My.app
…You still see the error 3 when
My2.app
tries to call SMLoginItemSetEnabled
But if you call
LSRegisterURL
before My2.app
tries to call SMLoginItemSetEnabled
…Things work
Is that correct?
Are you testing this on your development machine? If so, I suggest you run these tests on a fresh machine each time. Anything related to Launch Services (and the effect of
LSRegisterURL
indicates that this is related to Launch Services) is suspect on development machines. For some background on this, and specific advice on how to test, read
this post.
Share and Enjoy
—
Quinn “The Eskimo!”
Apple Developer Relations, Developer Technical Support, Core OS/Hardware
let myEmail = "eskimo" + "1" + "@apple.com"