1,207 questions
-1 votes
1 answer
205 views
Why KVO has no response while the rest of the code seems to work and runs without any error
// Inside root view controller - (void) play_test_video { g_video_test = [AVPlayer playerWithURL : file_url]; g_video_controller = [[AVPlayerViewController alloc] init]; ...
1 vote
1 answer
84 views
How to update collection view with KVO?
I want to show progress in collection view cell text label. I use this code to do it. Code from observer works and I see print progress in debug but I can't see this in cell. Why? KVO variant (not ...
0 votes
1 answer
85 views
incomprehensible bug when adding an observer using NSKeyValueObservingOptionInitial
I have a UI object (a subclass of NSObject called Label) that observes a property called region (subclass of NSManagedObject called Region) for three core data attributes: start (float) end (float) ...
-1 votes
1 answer
109 views
How to observe progress of fileCompletedCount with Swift keypath?
I am trying to replace old fashioned Objective-C way of observation to modern swift way of observation. However I cannot figure out the keypath. //doesn't work progress.observe(\.userInfo[...
0 votes
1 answer
66 views
Identify modified row for NSTableView bound with NSArrayController
I have an NSTableView bound to an NSArrayController, and have registered an observer for whenever data changes to the data fields that the array controller manages. For example, here's a few of the ...
2 votes
0 answers
149 views
Is it tracking progress of .loadTransferable(type:completion:) broken? It seems the returned progress class isn't updated
The .loadTransferable method returns a progress object (https://developer.apple.com/documentation/photokit/photospickeritem/4030160-loadtransferable) It seems the progress class returned from the ...
2 votes
1 answer
531 views
Tracking the progress of loadTransferable of a PhotosPickerItem
I am loading a video from the user's photo library. I want to track the progress of loadTransferable to update a progress view. However, I am having a ton of trouble observing the key values. I have ...
0 votes
1 answer
35 views
string.length keypath binding crashes during nib decode on Sonoma
Got few crash reports from macOS 14.0. After digging deep I found that issue is related to keypath bindings(NSDisplayPatternValueBinding) with NSObjectController and NSTextView. I bind NSTextView to ...
2 votes
1 answer
494 views
Scala spark dataframe map sorting as per key
import spark.implicits._ import org.apache.spark.sql.column def reverseMap(colName:Column) = map_from_arrays(map_values(colName),map_keys(colName)) val testDF = Seq(("cat",Map("black&...
0 votes
0 answers
189 views
xcode cannot resolve the entered keypath
Using Xcode 12, and starting with the default XIB-based swift desktop app, I add a Model class, descended from NSObject with a single stringValue property. In the XIB file I instantiate the Model ...
1 vote
1 answer
1k views
Is it possible to detect when the user answers the Bluetooth permission request on iOS?
Most of the permission requests on iOS these days have an API with a callback for when the user answers the request alert. Is it possible to get a similar effect for the Bluetooth permission request? ...
1 vote
0 answers
43 views
KVO publisher printing recursively in debugger
Why does the following LoginDateMonitorView result in hundreds of messages in the debugger? 2022-10-13 06:31:03.959864+0100 Test[4412:126282] [SwiftUI] Publishing changes from within view updates is ...
0 votes
1 answer
547 views
KVO observe AVAudioSession's recordPermission doesn't work
My application uses the microphone's permission, which is requested in another framework, and in the main application, I wasn't able to observe when microphone permission changed. I tried using KVO's ...
1 vote
1 answer
283 views
How to get Swift KVO working for static member?
I have a UIViewController with the following code. I want to know when the value of portrait effect is changed (in control center). I have tried AVCaptureDevice.isPortraitEffectEnabled and ....
-2 votes
1 answer
467 views
KVO publisher does not send signal on property change
I've just started learning Combine and am quite confused with behaviour of KVO publishers. They just do not publish any events except for the initial value. Here is the sample code I used: @objc class ...