Posts

Post not yet marked as solved
1 Replies
1.6k Views
Someone asked this question before, but the answer just talked about Objective-C, and now that post is locked.
Posted
by JWWalker.
Last updated
.
Post not yet marked as solved
3 Replies
1k Views
I can't find any documentation on CGRequestPostEventAccess or its friend CGRequestListenEventAccess, except for the API declarations in CGEvent.h. The fact that it returns a boolean and doesn't have a completion callback or anything like that suggests that it should be synchronous, i.e., not return until the user has decided to grant or deny permission. Experimentally, that doesn't seem to be the case, but then what does the return value mean?
Posted
by JWWalker.
Last updated
.
Post marked as solved
3 Replies
839 Views
If I enter a feedback ID like FB11832484, the last digit does not get highlighted, and is not part of the automatically-generated URL linked to the text. Looks like someone assumed that there will never be more than 7 digits in the feedback ID.
Posted
by JWWalker.
Last updated
.
Post marked as solved
2 Replies
1.4k Views
I'm trying to use -[SMAppService loginItemServiceWithIdentifier:] API, and after creating the SMAppServiceInstance, its status is SMAppServiceStatusNotFound. That means it didn't find the helper app? The documentation is a little mixed up. It says that the parameter is "The bundle identifier of the helper application", but also says "The property list name must correspond to a property list in the calling app’s Contents/Library/LoginItems directory". So which is it, a property list name or a bundle identifier? And it the thing in the LoginItems directory a helper application or a property list? What I have is an app bundle inside the Contents/Library/LoginItems of the app that's calling the SMAppService API. Or in other words, the given bundle identifier parameter is the CFBundleIdentifier value in Caller.app/Contents/Library/LoginItems/Helper.app/Contents/Info.plist. Is that not the right way to do it?
Posted
by JWWalker.
Last updated
.
Post not yet marked as solved
1 Replies
684 Views
I have a system preference pane that contains a background-only app that it wants to set as a login item. I understand that the proper way to set up login items in Ventura is by using the new SMAppService framework. In order to do so, I need an instance of SMAppService. I can't create it using +[SMAppService loginItemServiceWithIdentifier:], because that assumes that the login item is embedded in the calling app, and in this case the calling app is System Preferences. That leaves having the app itself get the mainAppService class property. But when I do that, and then ask the service for its status, the result is SMAppServiceStatusNotFound. That's documented as: An error occurred and the framework couldn’t find this service. What kind of error??? When I try this, I see some messages in Console from the tccd process that look like they might be related, but they don't clarify what's wrong. Must I just give up on using a system preference pane, and make my utility a plain old app containing a helper app?
Posted
by JWWalker.
Last updated
.
Post not yet marked as solved
1 Replies
728 Views
I have some NSViews that come and go during printing, and I want them to dealloc soon rather than waiting until the whole printing process is finished. The problem is that inside -[NSView addSubview:], the subview gets retained several times, and one of those schedules a release using CFRunLoopPerformBlock. But I don't have a run loop running, so that's not happening. The documentation of CFRunLoopPerformBlock says If you want the work performed right away, you must explicitly wake up that thread using the CFRunLoopWakeUp function. But calling CFRunLoopWakeUp( CFRunLoopGetMain() ) does not help, probably because the run loop is not running. If I call -[NSApplication nextEventMatchingMask: ...] in one of the standard modes, then the block from CFRunLoopPerformBlock runs, but too much other stuff also runs, such as queued notifications.
Posted
by JWWalker.
Last updated
.
Post marked as solved
4 Replies
4.4k Views
In the General system settings panel in Ventura, under Login Items, there are 2 sections: "Add Login Items", and "Login Items Added by Apps". What is this second category, and where can I find more about how to create such login items?
Posted
by JWWalker.
Last updated
.
Post marked as solved
2 Replies
897 Views
The docs on -[NSString stringWithFormat:] link to old docs on string format specifiers which say that “the %s specifier causes the characters to be interpreted in the system default encoding”. What the heck is the system default encoding? I tried googling it, and all I found was people saying that while a program may have a default encoding, the Mac OS does not.
Posted
by JWWalker.
Last updated
.
Post not yet marked as solved
1 Replies
907 Views
I'm trying to use signposts to help profile C++ code with Instruments (with Xcode 14 beta 5), and it's not working. A section of code in question, which is definitely getting reached, starts like this static os_log_t sSignpost_log = nullptr; if (__builtin_available( macOS 10.14, * )) { if (sSignpost_log == nullptr) { sSignpost_log = os_log_create( "com.frameforge.gscn", "PointsOfInterest" ); } os_signpost_interval_begin( sSignpost_log, 99, "com.frameforge.gscn" ); } and ends like this if (__builtin_available( macOS 10.14, * )) { os_signpost_interval_end( sSignpost_log, 99, "com.frameforge.gscn" ); } In Instruments, I have a Points of Interest instrument, and in the recording options for that instrument, I added 99 and com.frameforge.gscn as a row under "signpost code names". But after recording a run, the Points of Interest instrument always shows "No Data". I tried adding an os_signpost instrument, and it shows some data, but none of mine. What am I missing?
Posted
by JWWalker.
Last updated
.
Post not yet marked as solved
0 Replies
3.5k Views
Anyone have more understanding of how this is supposed to work , beyond the quick help "If enabled, the build system will sandbox user scripts to disallow undeclared input/output dependencies."? When I turned it on, one of my build scripts failed. Operation not permitted error: Sandbox: bash(29174) deny(1) file-read-data In this case, the input path is to a folder (a framework) and the output path is in the build directory. The paths are definitely correct, because the script accesses them as $SCRIPT_INPUT_FILE_0 and $SCRIPT_OUTPUT_FILE_0, so the script wouldn't work at all if I had an error in the paths. I tried putting a slash at the end of an input path, and then the error was just "operation not permitted", without mentioning the sandbox.
Posted
by JWWalker.
Last updated
.
Post not yet marked as solved
0 Replies
1k Views
In the documentation of -[NSBitmapImageRep initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:], it says that the bitmap format mask can include NSBitmapFormatFloatingPointSamples, which suggests that the answer is yes, but it also says that the number of bits per component can be at most 16, which suggests that the answer is no.
Posted
by JWWalker.
Last updated
.
Post not yet marked as solved
2 Replies
1.1k Views
When I try to use custom Core Image filters in the contentFilters property of an NSView, they don't work in Big Sur (as of 11.0.1 beta). They do work in Catalina. Doesn't matter if they're written using Metal or Core Image Kernel Language. I've reported this as a bug, but I'm wondering if there is some trick or workaround.
Posted
by JWWalker.
Last updated
.
Post not yet marked as solved
2 Replies
900 Views
The functions CFURLGetFSRef and CFURLCreateFromFSRef have deprecation warnings that say "not supported". That confuses me, because when I see "deprecated" I think "it may stop working at some point in the future", and when I see "not supported" I think "it doesn't work now". Which is it?
Posted
by JWWalker.
Last updated
.
Post not yet marked as solved
0 Replies
468 Views
I have a project with several targets, which use different header paths and have some C++ code conditionalized by preprocessor symbols with #if. The targets build without error, but "live issues" produces errors, because apparently it's using the wrong headers but the right preprocessor symbols. I've tried nuking the derived data. Any other suggestions? I'm using Xcode 13.2.
Posted
by JWWalker.
Last updated
.
Post not yet marked as solved
0 Replies
503 Views
What does it means when -[MTLDevice newRenderPipelineStateWithDescriptor:options:reflection:error:] returns the error "No primitive topology specified for layer selection program generation"? We've seen this after Ogre has compiled a vertex shader that uses [[viewport_array_index]] on a Mac with Nvidia graphics.
Posted
by JWWalker.
Last updated
.