Post

Replies

Boosts

Views

Activity

RunLoop behaviour change with performBlock?
I have a dedicated render thread with a run loop that has a CADisplayLink added to it (that's the only input source attached). The render thread has this loop in it: while (_continueRunLoop) { [runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate distantFuture]]; } I have some code to stop the render thread that sets _continueRunLoop to false in a block, and then does a pthread_join on the render thread: [_renderThreadRunLoop performBlock:^{ self->_continueRunLoop = NO; }]; pthread_join(_renderThread, NULL); I have noticed recently (iOS 18?) that if the Display Link is paused or invalidated before trying to stop the loop then the pthread_join blocks forever and the render thread is still sitting in the runMode:beforeDate: method. If the display link is still active then it does exit the loop, but only after one more turn of the display link callback. The most likely explanation I can think of is there has been a behaviour change to performBlock - I believe this used to "consume" a turn of the run loop, and exit the runMode:beforeDate call but now it happens without leaving that function. I can't find specific mention in the docs of the expected behaviour for performBlock - just that other RunLoop input sources cause the run method to exit, and timer sources do not. Is it possible that the behaviour has changed here?
4
0
81
4d
Tap to Pay implementation to use debit and credit card for payments
I am trying to implement Tap-To-Pay in my app. I want to use this feature to be able to read my debit card details and pass it to my payment processor SDK Cybersource to securely do the payment. I tried following this documentation https://developer.apple.com/tap-to-pay/#regions I want to know if this implementation is possible or not? If it is possible can you guide me the process on how to read card data? Thanks
1
0
52
4d
watchOS app workout doesn't launch
I am creating a watchOS app with XCode, and am experiencing an issue where workouts do not start on watchOS versions 9.6.3 and later. ・App specifications Start workout when app starts code (swift) workout?.startActivity(with: Date()) ·phenomenon In watchOS version 9.6.3 or later, after the Apple Watch runs out of battery or is turned off. When you turn on your Apple Watch and start using it, even if you start a workout (startActivity),The status may not change to running and the workout may not work. *Workout always worked on watchOS versions earlier than version 9.6.3. *The workout will work if you close the app and start the app again. If anyone has any information, please provide it.
0
0
54
4d
Can't ping ip address releated apple login
We want to support apple login in our application, and our domain has protection from public access, so we have followed document "Configuring your environment for Sign in with Apple" from Xcode ---> window --- > Developer Document to use ip connect to apple. when we ping the ip list in the document, like: 17.32.139.128/27 17.32.139.160/27 17.140.126.0/27 17.140.126.32/27 17.179.144.128/27 17.179.144.160/27 17.179.144.192/27 17.179.144.224/27 17.253.0.0/16 but they have no response. what's wrong with it? hope help!
0
0
45
4d
MAUI Application Crash in 14.5 version when click on Apple Logo
I have my application named "TestDataPro" in apple store. When I open the application and click on apple icon, my application crash. It is working fine in MACOS version 14.2.1. But it is causing crash in MACOS version 14.5 and 14.6 with having Apple M1 or M2 chip. While for the same MACOS version with having intel chip it is working fine. I have attached crash log. Can you please help me to find the root cause for this? TDPCrashReport.txt
0
0
39
4d
Testflight app cannot load the widgets
It is a very strange situation I am suffering now. I am hosting thingsboard CE on AWS EC2 (443, 1883, 80 and 8080 port are opened), I can access the console GUI through domain name, public IP and my ESP32 device can register and report MQTT data, all the widgets everything work like a charm ! I can use Simulator (iPhone 16 Plus Max) to access the dashboard, widgets, alarms, devices and audit logs, and I can install the Runner on my iPhone 16 Plus Max through Xcode and the Runner works well as expected on the Simulator. Whereas, when I created Testflight app, download and install the testing release in on my iPhone, I can access the GUI, see the dashboard, but after click the dashboard, all widgets cannot be loaded, thingsboard icon continues spinning ! The alarms, devices and audit logs on the Testflight app works well, no issues. Did you ever experience such issue? Thanks !
0
0
39
4d
ios 18.2 beta(22C5131E) Speech Recognition Discards Previously Transcribed Audio
I was testing SFSpeechRecognition on my real device running ios 18.2 beta, and found that the result's "final" field is true, the result itself does not contain entire conversation's transcription. I came across some blog posts saying it's fixed in a 18.1 beta, is this not the case for 18.2 beta? Example code: recognitionTask = recognizer.recognitionTask(with: request) { [weak self] result, error in guard let self = self else { return } if let error = error { DispatchQueue.main.async { self.errorMessage = "Transcription failed: \(error.localizedDescription)" self.isTranscribing = false } } else if let result = result, result.isFinal { // HERE! } }
4
0
131
4d
Problems with Widget buttons not getting pressed
So I have a button on a widget styled as seen below. I want this button to take up the entirety of the width, problem is, when it does so either using a frame(maxWidth: .infinity) or if I increase the horizontal padding, the button still only gets clicked if the user taps near the buttons center. Otherwise, it will open the app. Relevant code: Button(intent: Intent_StartRest() ){ Text("stop") } .buttonStyle(PlainButtonStyle()) .tint(.clear) .padding(.vertical, 6) .padding(.horizontal, 100) .background(RoundedRectangle(cornerRadius: 30).fill(.button)) .foregroundStyle(.buttonText) // Just sets text color .useAppFont(size: 18, relativeTo: .caption, weight: .bold) // Just sets font Any pointers?
0
0
82
4d
Is there documentation for the Swift KVO method `observe(_:options:changeHandler:)`?
I can't seem to find much documentation on the observe(_:options:changeHandler:) method itself. There is this page which has some example use, but there is no link to a 'real' documentation page for the method. Additionally the 'quick help' has a little bit of info, but no parameter definitions or explanation of if/how the return value or changeHandler closure are retained.
4
0
135
4d
Avoiding deletion of referenced records
Let's say I have a CloudKit database schema where I have records of type Author that are referenced by multiple records of type Article. I want to delete an Author record if no Article is referencing it. Now consider the following conflict: device A deleted the last Article referencing Author #42 device B uploads a new Article referencing Author #42 at the same time The result should be that Author #42 is not deleted after both operations are finished. But both device don't know from each other changes. So either device B could miss that device A deleted the author. Or device A could have missed that a new Article was uploaded and therefore the Author #42 was deleted right after the upload of device B. I though about using a reference count first. But this won't work if the ref count is part of the Author record. This is because deletions do not use the changeTag to detect lost updates: If device A found a reference count 0 and decides to delete the Author, it might miss that device B incremented the count meanwhile. I currently see two alternatives: Using a second record that outlives the Author to keep the reference count and using an atomic operation to update and delete it. So if the update fails, the delete would fail either. Always adding a new child record to the Author whenever a reference is made. We could call it ReferenceToken. Since child records may not become dangling, CloudKit would stop a deletion, if a new ReferenceToken sets the parent reference to the Author. Are there any better ways doing this?
0
0
85
4d
One-time privilege escalation in non-sandboxed apps
Hi, we are in the process of exploring how to create an installer for our array of apps. We have come to the conclusion that regular .pkg installers produced by pkgbuild and productbuild are unfulfilling of our expectations. [1] Regardless, our installer needs to place files at privileged locations (/Library/Application Support) so we are looking into how to best solve this problem, with the user having the largest clarity on what they are about to do (so no shady "wants to make changes" dialogs) the least steps to do to install these files in the right place (so no targeted NSSavePanel-s) Now, we have done our light reading via some nicely collected posts on the topic (https://forums.developer.apple.com/forums/thread/708765 for example) and the single missing option in the list of privilege escalation models seems to be a one-time privilege escalation from a GUI app. Our reasons for declaring so: AuthorizationExecuteWithPrivileges is long deprecated and we are trying to build a futureproof solution NSAppleScript is just putting up a shady ("wants to make changes") dialog when trying something like this: $ osascript -e "set filePath to \"/Library/Application Support\"" -e "do shell script \"touch \" & the quoted form of filePath & \"/yyy.txt\" with administrator privileges" Is there another way to request a one-time authorization from the admin to perform such a simple operation as copying a file to a protected location? I know it's possible to externalize and internalize Authorization Rights, but they are just an interface to create extra rights and use them as barriers, because they don't actually pass the required right to further operations based on this documentation. Using SMAppService to register a daemon, which has to be manually allowed by the user adds a lot to the complexity of this installation process, and is something we would like to avoid if possible. (And it's also not the right security model if we want to be honest - we don't want ongoing administrator rights and a daemon) Is there something we haven't taken into consideration? [1] preinstall scripts run after the choices are presented during installation and we would need advanced logic (not the limited JavaScript system/files API provided by Installer JS) - plus, the GUI is obviously very limited in a .pkg :(
2
0
150
4d
USB-C Accessory with iOS 18
Hello, We have noted that our USB-C accessory now supplies power and data after a role-switch when it previously would initialize with supplying power to the iOS device, then move to just transferring data to the iOS device after a role-switch. The charging+data behavior is only seen when the accessory is connected to a USB-C based iOS device running iOS 18. Are there some updates in iOS 18 that would cause this behavior? We noted that the expected case occurs with USB-C devices running on the earlier versions (iOS 17 and below).
1
0
122
4d
Getting a crash for SwiftData that only happens on iPhone 16 pro
I'm getting a crash in SwiftData but only on one specific device (iPhone 16 pro running 18.2 22C5131e) and not on an ipad or simulator I cant troubleshoot this crash and its quite frustrating, all I am getting is @Query(sort: \Todo.timestamp, order: .reverse) private var todos: [Todo] ForEach(todos.filter { !$0.completed }) { item in // <---crash TodoListView() } and the error is Thread 1: signal SIGABRT An abort signal terminated the process. Such crashes often happen because of an uncaught exception or unrecoverable error or calling the abort() function. and _SwiftData_SwiftUI.Query.wrappedValue.getter : τ_0_1 -> 0x105b98b58 <+160>: ldur x8, [x29, #-0x40] 0x105b98b5c <+164>: ldur x0, [x29, #-0x38] 0x105b98b60 <+168>: ldur x1, [x29, #-0x30] 0x105b98b64 <+172>: ldur x9, [x29, #-0x20] 0x105b98b68 <+176>: stur x9, [x29, #-0x28] 0x105b98b6c <+180>: ldr x8, [x8, #0x8] 0x105b98b70 <+184>: blr x8 0x105b98b74 <+188>: ldur x0, [x29, #-0x28] 0x105b98b78 <+192>: sub sp, x29, #0x10 0x105b98b7c <+196>: ldp x29, x30, [sp, #0x10] 0x105b98b80 <+200>: ldp x20, x19, [sp], #0x20 0x105b98b84 <+204>: ret How do I fix this?
0
0
105
4d
Display name for CloudKit container in the "Manage Storage" view of Settings
How can I set the display name of the CloudKit container in Settings -> iCloud -> Manage Storage. I have multiple containers, some legacy, and some for certain modules that are shared among a suite of apps. The problem is all Containers show the same name so it is not possible to advise a user which containers are safe to delete. I am using NSPersistentCloudKitContainer.
0
0
64
4d
Disable optimised battery charging notifiction
I am on the developer beta ios 18.2 beta 3 on Iphone 16 Pro Max and, if I enable battery optimization charging I am woken up during the night when it is charged to 100% (which by the way isn't a couple of hours before my scheduled alarm goes off at 05:30 every day it reaches 100 about 3-4 hours earlier). There are no other notifications firing and if I turn this off and set the charge limit to 80% it successfully charges to this overnight without any notifications. If there isn't an option please can one be added as currently, I am unable to use this feature without being woken up during the night? The charger is new and connection is fine as there are no other sounds until the optimized charging reaches 100%.
1
0
53
5d