Post

Replies

Boosts

Views

Activity

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 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
470
Apr ’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
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
648
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
443
Jan ’22
Determining if user has passkey for service already?
I'm working my way through adding passkey support to my app. At app launch, I'd like to test to see if the user has already created a passkey for the service, and if not, immediately present the account creation UI. Is there an API call I can make to see if the user already has a credential? From the examples I’ve found, it seems I should just try to sign in, and I’ll get an error callback if there are no stored credentials. Is that right?
4
0
2.1k
Mar ’24
App runs fine, but preview complains executeFetchRequest:error: A fetch request must have an entity..
I'm migrating my app from Obj-C to Swift. It uses Core Data, and most of the entities are implemented in Obj-C. I just took a stab at converting one of my views to SwiftUI, and it runs correctly, but Preview crashes with executeFetchRequest:error: A fetch request must have an entity.. I've tried declaring the fetch request both with and without the entity: argument: @FetchRequest(entity: NewsItem.entity(), sortDescriptors: []) var newsItems : FetchedResults<NewsItem>
1
2
819
Jun ’23
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
altool failed upload with Error: Unable to authenticate. (-19209)
altool seemed to be working correctly, but then failed after upload finished: $ xcrun altool --upload-package ../exports/OurApp.ipa --type ios --apple-id <apple-id> --bundle-id <bundle-id> --bundle-version 291 --bundle-short-version-string "3.1.5" --apiKey <api-key> --apiIssuer <issuer> --show-progress Getting list of providers... Beginning delivery... Analyzing package… Requesting app information… Requesting asset description upload id… Sending analysis to the App Store… Waiting for response… Requesting upload instructions from the App Store… Preparing to upload package to the App Store… Uploading package to the App Store… **status code 401, auth issue. *** Error: *** status code 401, auth issue. *** Error: Error uploading '../exports/OurApp.ipa'. *** Error: Unable to authenticate. (-19209) Note that --list-providers seems to work just fine with the same credentials: $ xcrun altool --list-providers --apiKey <key> --apiIssuer <issuer> Getting list of providers... ProviderName ProviderShortname PublicID WWDRTeamID ------------ ----------------- ------------------------------------ ---------- Whatnot Inc. <redacted> <redacted> <redacted> @eskimo?
7
0
3.5k
Apr ’22
Running built macOS app in 13.3 beta VM on M1?
I managed to get a macOS 13.3 beta install running in Parallels on my M1 VM, but it was really hard to get my app (built on my 13.2.1 M1 native macOS) installed on it, because so many features are unsupported in the VM (e.g. I can't drop files onto it like I can with other OSes, or on Intel; I can't log in with my Apple ID because Apple doesn't allow that, etc.). I finally copied it over using File Sharing from the VM, but the virtual OS won't launch it. It throws up a vague alert saying "The application can’t be opened." If I try to launch it from the command line, I get The application cannot be opened for an unexpected reason, error=Error Domain=RBSRequestErrorDomain Code=5 "Launch failed." UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x600000f2da10 {Error Domain=NSPOSIXErrorDomain Code=153 "Unknown error: 153" UserInfo={NSLocalizedDescription=Launchd job spawn failed}}} I assume it's some kind of code signing/gatekeeper issue, but I don't really know. I also tried this using the Apple virtualization framework and sample virtual machine tools (neat that those exist). I'm pretty sure this is exactly what Parallels is using internally, btw. It lacks a LOT. Is there any way to make running macOS betas in a VM a viable way of testing?
4
1
1.5k
Feb ’23
Xcode 15b2: Reference to 'Protocol' is ambiguous
I've got some old Objective-C code that up until Xcode 15 was compiling just fine. I recently spent time converting a lot of my project to Swift, which meant putting more stuff in the Bridging Header, but everything was fine. Till today. In file included from /Users/rmann/Projects/Personal/MyApp/repo/src/objc/MissionList/EventListCell.mm:18: In file included from /Users/rmann/Library/Developer/Xcode/DerivedData/MyApp-hkqhwvmmxqyxlkdlbpsbletzgerr/Build/Intermediates.noindex/MyApp.build/Debug-iphonesimulator/MyApp.build/DerivedSources/MyApp-Swift.h:288: In file included from /Users/rmann/Projects/Personal/MyApp/repo/src/BridgingHeader.h:8: /Users/rmann/Projects/Personal/MyApp/repo/src/objc/HessianClasses/CWHessianArchiver.h:52:55: error: reference to 'Protocol' is ambiguous +(void)setClassName:(NSString*)className forProtocol:(Protocol*)aProtocol; ^ note: candidate found by name lookup is 'Protocol' note: candidate found by name lookup is 'Protocol' This is code that uses NSProxy and passes it an Objective-C protocol. The build transcript does not show the locations of the alleged declarations. If I use Shift-Command-O and type "Protocol", I get /Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX.sdk/usr/include/objc/Protocol.h, which is unexpected, given that I'm running Xcode 15 beta 2. xcode-select -p gives /Applications/Xcode-beta.app/Contents/Developer. I call this a bug, as it compiles fine in Xcode 14.3, and if it should be an error, it should say why it's ambiguous. FB12434640
2
1
1k
Jun ’23
Xcode 15 "Missing package product" error when using local package path instead of url
I've got this SwiftPM project. It has a dependency that I needed to edit, so I forked it on github and checked it out locally. Then I referenced the local repo in the Package.swift file with package(path:) instead of package(url:). This caused it to report Package.swift: error: Missing package product 'WebAuthn' (in target 'App' from project 'server') I had to commit my changes, and re-reference the repo, to get it to see my updates. This problem has been around for some time, but seems to be related to how the path name differs from the built target name (it works fine in another project i have where the package directory and target have the same name). I've submitted FB13677717 about it, but is there a workaround?
0
1
2.8k
Mar ’24