Post

Replies

Boosts

Views

Activity

"Duplicate output file"/"Unable to build node" for localized folders
We have some HTML content embedded in our app. These live in two top-level folders. These folders have been localized, and so live in Resources/en.lproj/HelpContent and Resources/fr.lproj/HelpContent (for example). Similarly, we have a bunch of localized .storyboard files.Xcode 8 builds this just fine. Xcode 9b6 complains:duplicate output file '/Users/me/Library/Developer/Xcode/DerivedData/MyApp- fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/ HelpContent' on task: CpResource /Users/me/Projects/Clients/MyCompany/repo/mp_vision/iOS/Controller/MyApp /Resources/fr.lproj/HelpContent /Users/me/Library/Developer/Xcode/DerivedData/MyApp- fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/ HelpContent (in target 'MyApp')unable to build node: '/Users/me/Library/Developer/Xcode/DerivedData/MyApp- fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/ HelpContent' (node is produced by multiple commands; e.g., 'b1132708c20f997e752faabcee01d49c82a500833121dcd848c3954357d9f7b1: CpResource /Users/me/Projects/Clients/MyCompany/repo/mp_vision/iOS/Controller/MyApp /Resources/en.lproj/HelpContent /Users/me/Library/Developer/Xcode/DerivedData/MyApp- fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/ HelpContent' and 'b1132708c20f997e752faabcee01d49c82a500833121dcd848c3954357d9f7b1: CpResource /Users/me/Projects/Clients/MyCompany/repo/mp_vision/iOS/Controller/MyApp /Resources/fr.lproj/HelpContent /Users/me/Library/Developer/Xcode/DerivedData/MyApp- fdskkibuvbsubudkmqtgsjxmyqme/Build/Products/Debug-iphoneos/MyApp.app/ HelpContent')The Files & Groups list shows it correctly (e.g. "HelpContent" with "HelpContent (English)" and "HelpContent (French)" as sub-folders. The folders only show up once in the Copy Bundle Resources phase.But the build stops almost immediately on this error.
12
0
18k
Jan ’22
How to be a web browser on macOS?
Is there a way I can set my own app to be the default web browser on macOS? The System Preferences->General UI for choosing the default web browser doesn't have an obvious way to set an arbitrary app. Is there a way to configure my app so that macOS recognizes it as an option for this list?
0
1
444
Jan ’22
Any way to prevent macOS from repositioning my window?
My app has a utility window that can live anywhere on screen, including over the menu bar, or in the top region of a screen with a notch when the main screen is not the built-in display. If I drag the window into these areas, it sits there just fine. I have drag handlers in a subclass of NSWindow that call -setFrame: (yeah, this is Obj-C code). If the screen gets reconfigured, my code tries to remember where the window was, and calls -setFrame: to put it back there. But in this case, macOS moves my window down out of the menu bar/notch area at the top of the screen. Is there any way to prevent this behavior?
1
0
651
Jan ’22
Xcode 13 can't fails to prepare device for development after iOS 14.7.1 update
Has anyone else run into this and found a workaround? Xcode 13b1, 3, and 4 are unable to prepare my device for development after I updated it today to 14.7.1. Xcode 12.5.1 is able to. After churning for several minutes, it always ends up saying Failed to prepare device for development. I've rebooted the device and my Mac a few times each now. There's at least one other report of this issue: https://stackoverflow.com/questions/68549513/xcode-doesn-t-support-phone-s-ios-14-7-1
3
0
5.7k
Oct ’21
SwiftUI macOS: tracking the mouse in a view?
I've got macOS SwiftUI app that displays an image, currently using Image. I need to display information about the pixel under the mouse pointer (its position, color, etc.) in some text fields at the bottom of the window. I can't find an appropriate event handler to attach to Image. Traditionally I would have used mouseEntered, mouseExited, and mouseMoved. These are available for an NSHostingView, but that's for wrapping native views. I found onHover(), which takes the place of mouseEntered and mouseExited, but it neither works (the perform method is never called for me), nor does it provide movement and position.
4
2
7.4k
Aug ’21
13b2 ignoring CF_RETURNS_NOT_RETAINED?
I just downloaded and tried Xcode 13b2 on our iOS project. I've been using b1 with a surprising amount of success, switching to 12.5.1 for builds. But now 13b2 seems to have an issue. In our AVCapture code, you get handed an AVCapturePhoto, and it has methods that return CF_RETURNS_NOT_RETAINED/Unmanaged. If you try to .takeUnretainedValue() on these, the compiler complains that CGImage has no such method. It appears to be ignoring the Obj-C directive. I'm also unable to view the generated Swift file for that Obj-C header. I get "Couldn't generate Swift Representation" "Error (from SourceKit): Could not load the stdlib module". Anyone else run into this? I filed FB9211460 about it.
1
0
1.1k
Jul ’21
AppStoreConnect app icon won't show
I recently created a new app record in AppStoreConnect. The app is still in development and testing, so we use this for TestFlight builds. The app has a complete app icon internally, and shows up in the Simulator and devices correctly. But in AppStoreConnect, it shows the generic app icon placeholder. I contacted Apple support about this, and they told me I needed to include the app icon in the app. I told them I already do, and showed them the screenshots. They basically said sorry, not my problem, try the dev forums. So here I am.
0
0
727
Jun ’21
Xcode 13 templates don't add built products to navigator
I just created a new macOS app project in Xcode 13 beta. SwiftUI, unit tests, no Core Data. I just noticed that it does not add the traditional "Products/MyApp.app" group and file, and I can't figure out how to add those via the UI. At least one solution online edits the pbxproj file directly; I'd rather not do that. Is there any sanctioned way to add this? Is not having it a bug?
0
0
584
Jun ’21
Coalescing @Published changes?
I've got the following code that updates a @Published var messages: OrderedSetMessage property: swift public func add(messages inMsgs: [IncomingMessage]) { for msg in inMsgs { let msg = Message(fromIncoming: msg, user: user) self.messages.append(msg) } self.messages.sort() } In my SwiftUI view, however, .onChanged(self.stream.messages) gets called three times each time a single message is added. I tried operating on a local copy of self.messages, and then just setting self.messages = local, but that didn't change anything. Maybe the issue is on the SwftUI side? In any case, how are published updates to a property coalesced?
4
0
1.5k
May ’21
SwiftUI previews fail with
As in the locked question here - https://developer.apple.com/forums/thread/674534, I'm constantly running into this error: Compiling failed: 'main' attribute cannot be used in a module that contains top-level code Once it starts, it's not clear how to stop it. No changes were made to my AppDelegate (It's a mostly-UIKit app that I'm adding some SwiftUI views to). It compiles just fine with a regular build, but the SwiftUI preview can't build it. This is proving to be a real hindrance. I can sometimes clear the condition by cleaning build and test results, and relaunching Xcode. But not always. I filed FB9104575 and included the diagnostics.
0
0
606
May ’21
SwiftUI macOS app show new document on launch
As of 11.3, DocumentGroup defaults to showing the open panel (From the release notes: "DocumentGroup apps now show an Open panel on launch, even when iCloud isn’t in use. (66446310).") Seems like it was considered a bug before that it didn't. Thing is, I don't like this behavior and don't want it, especially while I'm working on my app. I want to automatically create a new document. Is there any way to set that?
0
0
472
Apr ’21