Post

Replies

Boosts

Views

Activity

Xcode build rule input files
As I understand it, when you define a custom build rule with a script, Xcode will pass each matching input file to your script though variables like INPUT_FILE_PATH. So you normally don't need to explicitly list input files. However, there is an "input files" section in the build rule definition. How is that used? I'm hoping that it only used for dependencies and deciding whether a rule needs to be run. For example, suppose my rule is compiling a source file. Normally I just want to re-run the compile if the source file changes, but if the compiler itself changes, I probably also want to recompile. Can I list the compiler as an input file?
0
0
1k
Jun ’21
Why would event tap creation fail?
On my Mac (running Ventura), so long as my app is granted accessibility permission in System Settings > Privacy & Security > Accessibility, I am able to create a global event tap like so: CFMachPortRef thePort = CGEventTapCreate( kCGAnnotatedSessionEventTap, kCGTailAppendEventTap, kCGEventTapOptionDefault, // active filter CGEventMaskBit(kCGEventKeyDown), CTapListener::MyTapCallback, NULL ); But on a user's computer, also running Ventura, the CGEventTapCreate call is apparently returning NULL, even though he's showing me a screen shot of the accessibility permission being turned on. Any ideas what I could be missing, or how to debug it?
0
0
1.1k
Jan ’23
generic Xcode archive for plugin
I'm building a plug-in for an app that I did not create, and I would like to notarize it. I know I can so that using notarytool, but it would be nice if I could do it using Xcode. However, when I archive, it creates a "generic Xcode archive". I've read TN3110: Resolving generic Xcode archive issue. Since the plugin is being created by itself rather than as part of a larger build product, I assume that I should use the SKIP_INSTALL = NO build setting. I am less sure of what to do with the INSTALL_PATH build setting. If I leave it empty, then nothing gets created in the Products folder of the archive. If I set it to some path, then the product is placed in the archive but nested in a subfolder of Products.
0
0
666
Jul ’23
Is there still a need for sending kAESync Apple Event to Finder?
I'm updating some very old code, and it sends an kAESync Apple Event to the Finder to let Finder know that a file has been created or updated. Does this still serve a purpose? I know that Apple Events still exist, but creating the event involves deprecated things like FSRef and AliasHandle. Possibly related: -[NSWorkspace noteFileSystemChanged:]. The documentation says that it informs the workspace object, so maybe it doesn't inform the Finder, and the documentation also says "Avoid calling this method if possible".
0
0
491
Sep ’23
How to simulate mouse events in my own app
I want to be able to simulate mouse clicks, moves, and drags within my own app. I can do that using CGEventPost, but that requires accessibility permission, which seems silly to require when I'm not trying to control another app. An alternative is to create mouse NSEvents and use -[NSApplication postEvent:atStart:]. By that approach, I am able to click a button and watch it highlight and unhighlight, but the mouse cursor never moves and the pressedMouseButtons class property of NSEvent never changes. Is there a better way to simulate mouse events without requiring accessibility permission?
0
0
797
Jan ’24
ENABLE_ENHANCED_SECURITY module file not found
When I tried turning on ENABLE_ENHANCED_SECURITY = YES in an Xcode 26.1 beta project, I got a bunch of "module file not found" errors like this: While building module 'CoreServices': In file included from <module-includes>:1: /Applications/Xcode26.1-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19:2: fatal error: module file '/Volumes/Work/Xcode-derived/PlainCalc3-gixjfymjqamwmufdwcseugzjehqa/Build/Intermediates.noindex/ExplicitPrecompiledModules/CoreFoundation-5POB3HW0BHFSPWLD7DOOKAULM.pcm' not found: module file not found 19 | #include <CoreFoundation/CoreFoundation.h> | ^ I tried deleting the project's derived data. Is this a known issue?
0
0
160
Sep ’25
Can safe area layout guidelines be used in a macOS XIB?
The documentation of the NSPopover property hasFullSizeContent says that when it's true, you should Use the safeAreaLayoutGuide of the contentViewController view to ensure that your content is fully visible and doesn’t become clipped when displayed. I can do that by adding auto-layout constraints programmatically, but is there a way to do it in the xib? When I googled it, the AI summary begins To use safe areas in a Mac XIB (Interface Builder), enable the "Use Safe Area Layout Guides" checkbox in the File Inspector for your view but I have not found any non-AI indications that such a checkbox exists for macOS. (I'm using Xcode 26.2.)
0
0
270
Jan ’26
performDrop returns true, but drag image animates away
I have a view that conforms to DropDelegate. When a file is dragged from the Finder and dropped on the view, the performDrop(info:) method successfully extracts a URL from the item provider and returns true, but the drag image slides away as if the drop had been rejected. Why? func performDrop(info: DropInfo) -> Bool { bgColor = .yellow let providers = info.itemProviders(for: [.fileURL]) print("performDrop, providers: \(providers.count)") if let aProvider = providers.first { if aProvider.hasItemConformingToTypeIdentifier(UTType.url.identifier) { aProvider.loadItem(forTypeIdentifier: UTType.url.identifier) { (item, error) in if let error = error { print("Error retrieving item provider data: \(error.localizedDescription)") return } if let url = item as? URL { print("Received file URL (from Data.1): \(url)") } else if let data = item as? Data, let url = URL(dataRepresentation: data, relativeTo: nil) { print("Received file URL (from Data.2): \(url)") } } } } return true }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
0
0
110
Feb ’26
Xcode build rule input files
As I understand it, when you define a custom build rule with a script, Xcode will pass each matching input file to your script though variables like INPUT_FILE_PATH. So you normally don't need to explicitly list input files. However, there is an "input files" section in the build rule definition. How is that used? I'm hoping that it only used for dependencies and deciding whether a rule needs to be run. For example, suppose my rule is compiling a source file. Normally I just want to re-run the compile if the source file changes, but if the compiler itself changes, I probably also want to recompile. Can I list the compiler as an input file?
Replies
0
Boosts
0
Views
1k
Activity
Jun ’21
TestFlight for Mac for non-App Store apps?
Will TestFlight for Mac be available for apps sold outside App Store?
Replies
0
Boosts
0
Views
820
Activity
Jun ’21
Crashes in EmojiFunctionRowIM_Extension
Since updating to macOS 11.5.2, I'm getting almost constant crashes in EmojiFunctionRowIM_Extension, whatever that is. I'm not using any emoji. Anyone else? Can anything be done?
Replies
0
Boosts
0
Views
714
Activity
Aug ’21
cryptic error from Metal on Mac with Nvidia GPU
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.
Replies
0
Boosts
0
Views
677
Activity
Nov ’21
Why would event tap creation fail?
On my Mac (running Ventura), so long as my app is granted accessibility permission in System Settings > Privacy & Security > Accessibility, I am able to create a global event tap like so: CFMachPortRef thePort = CGEventTapCreate( kCGAnnotatedSessionEventTap, kCGTailAppendEventTap, kCGEventTapOptionDefault, // active filter CGEventMaskBit(kCGEventKeyDown), CTapListener::MyTapCallback, NULL ); But on a user's computer, also running Ventura, the CGEventTapCreate call is apparently returning NULL, even though he's showing me a screen shot of the accessibility permission being turned on. Any ideas what I could be missing, or how to debug it?
Replies
0
Boosts
0
Views
1.1k
Activity
Jan ’23
generic Xcode archive for plugin
I'm building a plug-in for an app that I did not create, and I would like to notarize it. I know I can so that using notarytool, but it would be nice if I could do it using Xcode. However, when I archive, it creates a "generic Xcode archive". I've read TN3110: Resolving generic Xcode archive issue. Since the plugin is being created by itself rather than as part of a larger build product, I assume that I should use the SKIP_INSTALL = NO build setting. I am less sure of what to do with the INSTALL_PATH build setting. If I leave it empty, then nothing gets created in the Products folder of the archive. If I set it to some path, then the product is placed in the archive but nested in a subfolder of Products.
Replies
0
Boosts
0
Views
666
Activity
Jul ’23
Is there still a need for sending kAESync Apple Event to Finder?
I'm updating some very old code, and it sends an kAESync Apple Event to the Finder to let Finder know that a file has been created or updated. Does this still serve a purpose? I know that Apple Events still exist, but creating the event involves deprecated things like FSRef and AliasHandle. Possibly related: -[NSWorkspace noteFileSystemChanged:]. The documentation says that it informs the workspace object, so maybe it doesn't inform the Finder, and the documentation also says "Avoid calling this method if possible".
Replies
0
Boosts
0
Views
491
Activity
Sep ’23
`+[CIPlugIn loadAllPlugIns]` deprecated, what is the replacement?
I just noticed that +[CIPlugIn loadAllPlugIns] has been deprecated since 10.15 (OK, I'm a little slow), along with all the other CIPlugIn methods except for loadNonExecutablePlugIns. I don't see any documentation about what I'm supposed to do instead. What's the deal?
Replies
0
Boosts
0
Views
622
Activity
Nov ’23
"Last Updated" date not updating
I replied to this thread a couple of hours ago, but the recent post list, sorted by Last Update, does not show it, and my watch list shows an update date based on a previous reply.
Replies
0
Boosts
0
Views
883
Activity
Jan ’24
How to simulate mouse events in my own app
I want to be able to simulate mouse clicks, moves, and drags within my own app. I can do that using CGEventPost, but that requires accessibility permission, which seems silly to require when I'm not trying to control another app. An alternative is to create mouse NSEvents and use -[NSApplication postEvent:atStart:]. By that approach, I am able to click a button and watch it highlight and unhighlight, but the mouse cursor never moves and the pressedMouseButtons class property of NSEvent never changes. Is there a better way to simulate mouse events without requiring accessibility permission?
Replies
0
Boosts
0
Views
797
Activity
Jan ’24
Icon Composer and macOS compatibility
If I use the new beta Icon Composer to make a .icon file for a macOS app, will it work for any macOS versions before 26? If not, can one build with both the .icon and the older asset collection icon?
Replies
0
Boosts
1
Views
254
Activity
Sep ’25
ENABLE_ENHANCED_SECURITY module file not found
When I tried turning on ENABLE_ENHANCED_SECURITY = YES in an Xcode 26.1 beta project, I got a bunch of "module file not found" errors like this: While building module 'CoreServices': In file included from <module-includes>:1: /Applications/Xcode26.1-beta.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/System/Library/Frameworks/CoreServices.framework/Headers/CoreServices.h:19:2: fatal error: module file '/Volumes/Work/Xcode-derived/PlainCalc3-gixjfymjqamwmufdwcseugzjehqa/Build/Intermediates.noindex/ExplicitPrecompiledModules/CoreFoundation-5POB3HW0BHFSPWLD7DOOKAULM.pcm' not found: module file not found 19 | #include <CoreFoundation/CoreFoundation.h> | ^ I tried deleting the project's derived data. Is this a known issue?
Replies
0
Boosts
0
Views
160
Activity
Sep ’25
Can safe area layout guidelines be used in a macOS XIB?
The documentation of the NSPopover property hasFullSizeContent says that when it's true, you should Use the safeAreaLayoutGuide of the contentViewController view to ensure that your content is fully visible and doesn’t become clipped when displayed. I can do that by adding auto-layout constraints programmatically, but is there a way to do it in the xib? When I googled it, the AI summary begins To use safe areas in a Mac XIB (Interface Builder), enable the "Use Safe Area Layout Guides" checkbox in the File Inspector for your view but I have not found any non-AI indications that such a checkbox exists for macOS. (I'm using Xcode 26.2.)
Replies
0
Boosts
0
Views
270
Activity
Jan ’26
performDrop returns true, but drag image animates away
I have a view that conforms to DropDelegate. When a file is dragged from the Finder and dropped on the view, the performDrop(info:) method successfully extracts a URL from the item provider and returns true, but the drag image slides away as if the drop had been rejected. Why? func performDrop(info: DropInfo) -> Bool { bgColor = .yellow let providers = info.itemProviders(for: [.fileURL]) print("performDrop, providers: \(providers.count)") if let aProvider = providers.first { if aProvider.hasItemConformingToTypeIdentifier(UTType.url.identifier) { aProvider.loadItem(forTypeIdentifier: UTType.url.identifier) { (item, error) in if let error = error { print("Error retrieving item provider data: \(error.localizedDescription)") return } if let url = item as? URL { print("Received file URL (from Data.1): \(url)") } else if let data = item as? Data, let url = URL(dataRepresentation: data, relativeTo: nil) { print("Received file URL (from Data.2): \(url)") } } } } return true }
Topic: UI Frameworks SubTopic: SwiftUI Tags:
Replies
0
Boosts
0
Views
110
Activity
Feb ’26
Tables built by Xcode 13 beta don't work in macOS 10.12
When I use the Xcode 13 beta to build an app, view-based NSTableViews don't draw anything when the app is run under macOS 10.12 or earlier. I filed a bug (FB9278241), just wondering if anyone has any insight or workaround.
Replies
1
Boosts
0
Views
933
Activity
Jul ’21