Search results for

show when run

112,682 results found

Post

Replies

Boosts

Views

Activity

Reply to SwiftUI using Mac Catalyst destination the destination but provided destination is iPhone 17 Pro
Thank you for your post. May I request that you create a focused sample that developers in the forums can run and observe the results? When running a SwiftUI app designed for iPad on Mac Catalyst, it can be challenging to ensure that the UI scales appropriately and fills the available screen space. However I am confused your iPad target is an iPhone 17? Ensure that your main view is set to expand and fill the available space. You can try using to understand the available space and adjust your layout accordingly. Mac Catalyst provides specific modifiers and environment values you can leverage to better adapt your UI. Ensure that the Mac Catalyst app’s window toolbar isn’t consuming excessive space or causing layout issues. Test your app with different Mac resolutions or window sizes to confirm whether the layout issue is specific to certain dimensions or more general. Since you are using Xcode 26.2 (17C52), ensure that you are also on the latest version of macOS. I look forward to seeing your
Topic: UI Frameworks SubTopic: SwiftUI Tags:
5d
Reply to In app purchases
// StoreView.swift import StoreKit import SwiftUI struct StoreView: View { @ObservedObject private var storeController = StoreActor.shared.productController var hasPro: Bool { storeController.isEntitled } var body: some View { if let product = storeController.product, !storeController.isEntitled { // Pro features available to the user TO PURCHASE if(product.displayName == ProductNames.pro.humanReadablePurchaseLevel()) { // Show the product in a nice way, using the properties of the `product` variable ProductRow(product: product) } } if(hasPro) { // The user has already purchased the pro version, so show the pro features } } } struct ProductRow: View { @ObservedObject private var storeController = StoreActor.shared.productController var product: Product var body: some View { Text(Upgrade to (product.displayName)) Text(product.description) // Purchase button Button { Task(priority: .userInitiated) { await storeController.purchase() } } label: { Text((product.displayPrice)) } } }
5d
Exporting and re-importing ECC keys with file-based keychain
I'm trying to export and re-import a P-256 private key that was originally generated via SecKeyCreateRandomKey(), but I keep running into roadblocks. The key is simply exported via SecItemExport() with format formatWrappedPKCS8, and I did set a password just to be sure. Do note that I must use the file-based keychain, as the data protection keychain requires a restricted entitlement and I'm not going to pay a yearly fee just to securely store some private keys for a personal project. The 7-day limit for unsigned/self-signed binaries isn't feasible either. Here's pretty much everything I could think of trying: Simply using SecItemImport() does import the key, but I cannot set kSecAttrLabel and more importantly: kSecAttrApplicationTag. There just isn't any way to pass these attributes upfront, so it's always imported as Imported Private Key with an empty comment. Keys don't support many attributes to begin with and I need something that's unique to my program but shared across all the relevant key entr
4
0
991
5d
App Clips Causing CPSErrorDomain error 2 on Non App Clip URLs
Unexpected behavior encountered when scanning NFC tags. Imagine a link shortener web service where users can create lots of different URLs that are hosted on the same domain eg, https://short.com/unique-path The service has optional App Clip capability -- users can select any of their links and have the service create an App Clip for the selected link(s). Users can encode their URLs into NFC tags and have their customers scan NFC tags. Let's take just two URLs for example: https://short.com/foo https://short.com/bar The /foo link does have an App Clip associated with it while /bar does not have it. Each link has been encoded into appropriate NFC tag. Expected behavior when scanning from an iPhone: /foo -- shows an App Clip popup. /bar -- shows a Open in Safari default notification. What's actually happening /foo -- opens App Clip poput with correct metadata (title, subtitle, image) which is totally expected behavior. /bar (the one that doesn't have app clip associated with it) -- opens an Ap
17
0
718
6d
Reply to XProtect makes app hang when running an AppleScript
Oh, one more thing. That dispatch_sync call being made by XProtect is doing some one-time initialisation. That initialisation has to be done on the main thread. So, you might be able to work around this by forcing that initialisation to run on the main thread in advance of all this secondary thread work. An easy way to do that would be to use NSAppleScript to run a trivial script from the main thread as part of your app init sequence. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Privacy & Security SubTopic: General Tags:
6d
Reply to XProtect makes app hang when running an AppleScript
Thanks for attaching a sysdiagnose log to your bug (FB21334477). I took a look at the enclosed spin dump and I see this: Thread 0x222f6b 180 samples (216-395) priority 31 (base 31) cpu time 0.016s (43.3M cycles, 111.3M in… 180 thread_start + 8 (libsystem_pthread.dylib + 7080) [0x19ea8cba8] 180 _pthread_start + 136 (libsystem_pthread.dylib + 27656) [0x19ea91c08] 180 ??? (XojoFramework + 1309844) [0x10569bc94] 180 ??? (XojoFramework + 2624740) [0x1057dcce4] … redacted … 180 -[NSAppleScript compileAndReturnError:] + 136 (Foundation + 9808488) [0x1a0c7da68] 180 OSACompile + 52 (OpenScripting + 78068) [0x1bffa30f4] 180 SecurityPolicyTestDescriptor + 152 (OpenScripting + 8836) [0x1bff92284] 180 _SecurityPolicyTest(char const*, void const*, unsigned long) + 332 (OpenScripting + 8472) … 180 InterpreterSecurity_ScanBuffer + 112 (libInterpreterSecurity.dylib + 4868) [0x298e39304] 180 -[InterpreterSecurity scanData:withSourceURL:] + 164 (libInterpreterSecurity.dylib + 3… 180 -[XProtectScan beginAnalysisWithFeedback:] +
Topic: Privacy & Security SubTopic: General Tags:
6d
Reply to iOS UserDefaults Intermittently Returns Nil After getPreferences() Call - Race Condition?
Looking at the code you posted, the only way [1] that preferences can be nil at line 15 is if your decoded object code fails. You didn’t show that code, so it’s hard to tell what’s going on there. It sounds like you can reproduce this reasonably reliably. Given that, you can debug this using logging. I have general advice on that topic in Testing and Debugging Code Running in the Background. IMPORTANT It’s time to stop using NSLog habitually. Rather, use print(…) for transient debugging and Logger for debugging that you want to keep in your codebase (or for cases like this, where you need to debug without Xcode being attached). Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com [1] Well, not the only way. You could be dealing with an issue that’s outside of the scope of the Objective-C / Swift execution models, like a memory corruption problem. However, let’s rule out the easy things first (-:
Topic: App & System Services SubTopic: General Tags:
6d
iOS UserDefaults Intermittently Returns Nil After getPreferences() Call - Race Condition?
iOS Intermittent Bug: UserDefaults Preferences Loading Issue Problem Summary We're experiencing an intermittent issue where UserPreferences.shared.preferences returns inconsistent values even after calling getPreferences(). The behavior is unpredictable and affects critical functionality. Environment iOS Version: 15+ Language: Objective-C with Swift interop Storage: UserDefaults with App Group (group.com.jci.tyco.glss) Architecture: Singleton pattern for UserPreferences (Swift class) The Issue When a push notification arrives and triggers the showEvent: method, user preferences are sometimes loaded correctly and sometimes return nil or default values: Scenario A (Works - ~60% of time): Scenario B (Fails - ~40% of time): Observed Pattern From extensive logging over multiple test runs: Key Observation: At app launch: Preferences often load successfully Seconds later when push arrives: Same preferences become unavailable User navigates to another screen and back: Preferences suddenly work again Code Str
1
0
78
6d
xcrun notarytool submit going on 48 hours "In Progress"
I've submitted my app four times, each time waiting a few hours for something to happen, then reducing the file size of my *.dmg and trying again. The first two seemed to have completed after 36 hours, but I no longer have that specific signed binary (and its a much smaller binary now anyway). The latest two are still In Progress and its almost been 48 hours. I know my process isn't wrong, and my app isn't somehow incorrectly built or being denied because two were accepted. The outage page shows green for the notary tool (https://developer.apple.com/system-status/) so I'm not sure what the hold up is.
1
0
86
6d
Reply to AppleAVBAudio assertion information
I can’t really help with the AVB side of this, so I’m hoping someone else will chime in on that front. However, I have insight into the logging. The assert you’re hitting shows a bunch of values because: The log point indicates that the data is private. Our system don’t record private data by default. Presuming that you’re on the Mac, you can configure the system to record that data. See Recording Private Data in the System Log. If this works and you’re able to unmask all those values, please post the results here and I’ll take another look. Share and Enjoy — Quinn “The Eskimo!” @ Developer Technical Support @ Apple let myEmail = eskimo + 1 + @ + apple.com
Topic: Media Technologies SubTopic: Audio Tags:
6d
Alternative Methods to Display App Icon in Core Spotlight Search Results Besides CFBundleDocumentTypes
I'm developing an iOS app that handles custom file types (e.g., .k files), and I want to ensure my app's icon appears in Core Spotlight search results, similar to how 两步路户外助手's icon shows up for associated files (as shown in the attached screenshot from iOS search). I know one standard way is to configure CFBundleDocumentTypes in the Info.plist to declare supported document types, which allows the system to associate files with my app and display the icon in search. However, I'm looking for alternative approaches or additional configurations that could achieve this without relying solely on CFBundleDocumentTypes, or perhaps in combination with it for better integration. For context: This is for iOS 26+ (or latest versions). The goal is to have the app icon visible directly in Spotlight/Core Spotlight results when searching for files or content indexed by my app. I've tried basic NSUserActivity and CSSearchableItem indexing, but the icon doesn't always appear as expected for file associations. Has any
1
0
149
6d
Notarization wipes the "Icon?" file
In an AppleScript applet, compiling and exporting in Script Editor replaces a custom icon with the default. To retain a custom icon, it is necessary, after exporting, to use Finder's Get info... to copy the icon from another file and paste into the icon for the applet. The custom icon is stored in the Icon? file, located in the root of the applet bundle. The applet can then be signed and notarized. With macOS Tahoe, that procedure no longer works. That is because the notarization process now wipes the Icon? file. The file remains in place but has zero size. Thus Finder shows the default applet icon. Does anyone know of a way to provide a custom icon for a signed and notarized AppleScript applet ?
5
0
1.1k
6d
Reply to Notarization wipes the "Icon?" file
Hello Quinn, many thanks for all this. Normally I use Script Debugger to export my applet run-only. Then, I use SD Notary to sign and notarize. I will try to put your suggestion into that workflow. Up until Tahoe, I was avoiding Script Editor partly because it ignored/wiped my custom icon no matter what I tried. SD, did not. I don't know how to use Xcode. Have tried a few times but found it impenetrable. It will take me some time to get it working even to just create a dummy app with a custom icon. Cheers.
Topic: Code Signing SubTopic: Notarization Tags:
6d
Reply to Notarization Rejection - The binary is not signed with a valid Developer ID certificate
Thank you for your guidance on focusing on the packaging rather than the certificate! Following your recommendation, I ran systematic tests and identified the exact root cause. Summary The Developer ID Application certificate works perfectly. The Developer ID Installer certificate has a broken chain. Test Results I created an automated diagnostic that tested 5 different combinations: Test Executable Packaging Result 1 Compiled Swift binary ditto (.zip) ✅ Accepted 2 Compiled C binary pkgbuild (.pkg) ❌ Invalid 3 Shell script ditto (.zip) ✅ Accepted 4 Shell script pkgbuild (.pkg) ❌ Invalid 5 Compiled C binary productbuild (.pkg) ❌ Invalid Pattern: Every .zip passes. Every .pkg fails. The Issue When signing with the Installer certificate, this warning appears: Warning: unable to build chain to self-signed root for signer Developer ID Installer: Matthew Seymour Greer (W2AT7M9482) This warning does NOT appear when signing .app bundles with the Application certificate. The Installer certificate can sign locally, but
Topic: Code Signing SubTopic: Notarization Tags:
6d