Questions tagged [key-value-observing]

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

1201 questions
0
votes
1 answer

How to validate values of UICollectionViewCell from the UICollectionViewController

I have the following design problem, and i hope that anybody will help me to solve it :) I have a view controller that takes a questionnaire model instance and render this questionnaire using a collectionview. This questionnaire model contains an…
0
votes
0 answers

How to use KVO as an alternative to custom delegates

I am an iOS programmer. I just started learning coding for MAC OSX . But now I am having tough time coding for MAC OSX . The terms KVO and Bindings making my life tougher. There are document available but none of the document gives complete idea to…
Raj
  • 1,119
  • 1
  • 15
  • 32
0
votes
0 answers

Why am I receiving an observeValueForKeyPath:ofObject:change:context: message with a null observed object?

I have an object that is receiving an observeValueForKeyPath:ofObject:change:context: message which it is not handling. This seems to be because I decide whether to handle it or not based on the class of the observed object, and in this case the…
Rupert
  • 2,097
  • 19
  • 28
0
votes
1 answer

How to make the NSCollectionView reload data?

I create an NSCollectionView using cocoa binding.I find that when the NSMutableArray ,which is set as the NSCollectionView's content , finish to sort,the NSCollectionView has no change. Here is my sort code: -(void)updateOrder { [self…
gohamgx
  • 273
  • 2
  • 16
0
votes
3 answers

How to reload UITableView when I add a new element to NSMutableArray in another class?

I have a singleton object which has ivar NSMutableArray which holds images global to application. And I have a UITableViewController class which represents image attaches to the message.I want to do next: when user select images from Camera Roll…
0
votes
2 answers

How to debug why an object sent a KVO notification?

I'm subscribing to KVO notifications from an object. I seem to be receiving notifications for keypaths of the object that shouldn't be changing. Whats the best way to determine how these objects were changed (i.e. by what code) that resulted in…
aloo
  • 5,331
  • 7
  • 55
  • 94
0
votes
2 answers

Key Value Observing add three observers to observe a single class value

I have about four classes let us assume A,B,C and D ,Now my classes B,C,D need to observe the value of class A and get notified when the value changes. I have observed the value in class B and I am not able to get notified in the other two classes…
Super Xtreem
  • 187
  • 1
  • 10
0
votes
2 answers

Errors of key value observers and NSKVODeallocateBreak

I'm implementing a UITableView as a first level view controller that contains 5 table cells. Hitting on any of these cells will present a second level view. At the top left of this level view, there is a "back" button to return to the first level…
S1U
  • 825
  • 2
  • 14
  • 26
0
votes
3 answers

3 notifications instead of one

I'm developing simple MVC app in Cocoa/Objective-C. I have a strange issue (or misunderstanding) with notifications and KVO. I have AppController object in MainMenu.xib, hence I implement awakeFromNib method where I register for NSImageView changing…
Eimantas
  • 48,927
  • 17
  • 132
  • 168
0
votes
1 answer

Test if NSObject is observing string

I have a NSObject that listens for ~30 string signals. I want to post any number of strings to this object. But I first want to test to see if it's observing the current string. The documentation for [NSNotificationCenter][1] doesn't suggest…
stephen
  • 1,039
  • 14
  • 31
0
votes
1 answer

KVO Loading a new view with existing model data

I've recently begun to discover what can be done with KVO and I'm refactoring some of my code and saving a lot of lines at the same time. I do face one issue that is so general that it makes me wonder whether a certain pattern is recommended. In…
Tom
  • 2,674
  • 1
  • 25
  • 33
0
votes
1 answer

How to add observer to an AppDelegate?

I am trying to add an observer to a property of AppDelgate but its not working for some reason, so just wanted to know if i am missing something. Here's the code i am using: AppDelegate.h @property(strong, nonatomic) NSDictionary *…
Ashutosh
  • 5,614
  • 13
  • 52
  • 84
0
votes
1 answer

Many to one relationship messaging, KVO or NSNotification

Could someone please advise me on best or practical way of creating a many to one relationship messaging system. I am new to Objective-C so if this something that I "should know" as an Obj-C developer, please feel free to point me in the right…
0
votes
1 answer

UILabel KVO observing

I am going nuts, I looked everywhere on the web but I always found the same code for KVO observing. Yet my observeValueForKeyPath: is never called; this is the simple code I use to observe UILabel taximeterValue: -(id) initWithCoder:(NSCoder…
Fabrizio Bartolomucci
  • 4,948
  • 8
  • 43
  • 75
0
votes
2 answers

iOS Key Value Observing Xcode Project Problems

I'm now learning key value observing, have a very simple KVO project have a little problems that dont't print property new value changes when observeValueForKeyPath:(NSString *)keyPath ofObject:(id)object change:(NSDictionary *)change context:(void…
Andy_24
  • 1,353
  • 2
  • 12
  • 20