Questions tagged [key-value-observing]

Key-value Observing or KVO is a technology for observing changes in object properties.

1201 questions
0
votes
0 answers

NSManagedObject ignores return value of automaticallyNotifiesObserversForKey: ands KVO notifications

I noticed that changing a managed property in a subclass of NSManagedObject sends KVO notifications, even if I overwrite the automaticallyNotifiesObserversForKey: to return NO. +(BOOL)automaticallyNotifiesObserversForKey:(NSString *)key{ return…
0
votes
0 answers

KVC and accessor methods

I have a understanding problem with one aspect of KVC and accessor method. When I access my getter/setter methods with self.variable/self.setVariable the method observeValueForKeyPath:ofObject:change:context: gets executed But if I understand…
hashier
  • 4,670
  • 1
  • 28
  • 41
0
votes
0 answers

Key value observing doesn't update object after screen lock

I have encountered a weird problem with key value observing in iOS. I have an object to which I add observers to monitor download progress: [inAppProduct addObserver:self forKeyPath:@"progress" options:0 context:nil]; I then implement the method -…
pajevic
  • 4,607
  • 4
  • 39
  • 73
0
votes
0 answers

NSConcreteValue valueForUndefinedKey this class is not key value coding-compliant for the key

This happens when I start the application and taps rapidly on the screen while starting. I have no clues in the stacktrace since its all inside the framework. I'm fearing it might have something to do with ReactiveCocoa 2.0. Error Terminating app…
hfossli
  • 22,616
  • 10
  • 116
  • 130
0
votes
2 answers

NSManagedObjectContext does not notify observer of changes for transients

I am trying to clean up some transient property recalculation events. In development I have just used a very broad stroke of updating on almost all changes. Now I am trying to determine the best practice, checking for relevant keys and updating as…
0
votes
1 answer

How to create KVO for a TextField [Mac OS]?

I need to create KVO for TextField1 and when changing its value transfer value of TextField1 to TextFiled2. I tried so: //.h @property (weak) IBOutlet NSTextFieldCell *text1; @property (weak) IBOutlet NSTextFieldCell *text2; //.m -(id) init { …
Adam Shakhabov
  • 1,194
  • 2
  • 14
  • 35
0
votes
1 answer

NSTreeController KVO issue

I have a NSTreeController which array is bound to a "items" (custom) property of an NSArrayController subclass. As the tree controller is not bound to the selection of the NSArrayController I need to make sure to let the tree controller know that…
diederikh
  • 25,221
  • 5
  • 36
  • 49
0
votes
1 answer

How to setup a SIMPLE viewbased NSTableView using binding? SampleCode provided

I have literally tried everything.. and im sure my problem is probably something really stupid. I have look at Apple's Doc on how to set this up, but yet it doesn't seem to be working. Can someone please tell me what i did wrong? The App has one…
Just a coder
  • 15,480
  • 16
  • 85
  • 138
0
votes
1 answer

Receive KVO notification even there is no change? This only happens in iOS6, no trouble in iOS7

Code here: [self.textView addObserver:self forKeyPath:@"contentSize" options:NSKeyValueObservingOptionNew context:nil]; observing method - (void)observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change…
Gary Lyn
  • 1,088
  • 9
  • 11
0
votes
1 answer

Why add/remove method was called automatically when NSArrayController binds to an array?

I'm trying to understand how NSArrayController works... When I create an NSMutableArray "employeeArray" to hold "Person" object. I use NSArrayController in GUI and bind with the "employeeArray". I add two buttons for adding and removing "Person"…
Strong84
  • 1,869
  • 2
  • 19
  • 24
0
votes
1 answer

Detecting brief break in connection with AVPlayerItem

If I start this stream and then turn wifi off, "playbackBufferEmpty" is fired and I can respond by attempting to restart the stream. However if I turn wifi off and back on again straight away, the stream stops playing but none of the observers are…
TijuanaKez
  • 1,472
  • 3
  • 20
  • 28
0
votes
0 answers

Is it OK to use dot-syntax getters within an NSManagedObject's custom class?

Generally speaking... in an NSManagedObject class, inside one of the setters for a given float dynamic property, is it OK to use the dot-syntax getters for other float dynamic properties of the same NSManagedObject within that setter? Or do I need…
CommaToast
  • 11,370
  • 7
  • 54
  • 69
0
votes
1 answer

Core Data Many-to-Many relationship update causes fault

I am working on a project with the following many-to-many model: Book: can have multiple tags (book.tags) Tag: can include a lot of books (tag.books) i found that when a book is already in database and i just simply want to add a tag to that book by…
Erben Mo
  • 3,528
  • 3
  • 19
  • 32
0
votes
1 answer

Clang static analyzer warns about consumed block

I have the following code (in a non-ARC project): - (void)loadWithCompleteBlock:(void (^)(void))complete { ... complete = [complete copy]; ... [[NSOperationQueue mainQueue] addObserver:self…
Alexander
  • 1,495
  • 2
  • 19
  • 24
0
votes
1 answer

KVO: how to call setValue... inside setValue and not get into infinite loop?

I am writing a programme for Mac OS X, and came across the following problem: In one of my classes there is a number of boolean properties, which are accessed using KVO (that is, by valueForKey: and setValue:forKey: methods. Their number is likely…
Ibolit
  • 9,218
  • 7
  • 52
  • 96