Key-value Observing or KVO is a technology for observing changes in object properties.
Questions tagged [key-value-observing]
1201 questions
0
votes
1 answer
Best way to handle enable/disable of UIButtons on iPhone
I have an increase button and a decrease button, both of which affect a variable. The variable has a minimum and the decrease button will be disabled once that minimum is reached. Likewise for the maximum value of the variable. In my controller,…

Anonymous
- 1,750
- 3
- 16
- 21
0
votes
2 answers
KVO - observeValueForKeyPath not being called
Summary of what Im trying to do.
I have a NSMutableString property called mailText in my AppDelegate.h, whenever I change the value of this property, I want my viewController to be notified and it will set the value of its local IBOutlet property…

ArvindSN
- 1
- 2
0
votes
1 answer
NSProgress when to remove the observer
NSProgress is a useful class for tracking progress across queues. It relies on observing the "fractionCompleted" property. But when/how are you supposed to remove the observer? I tried dispatch_group and dispatch_barrier but the observer is still…

user965972
- 2,489
- 2
- 23
- 39
0
votes
1 answer
KVO on helper property
I have a property to an object instance in my class
@property(nonatomic, strong) MyObject *myObject;
And I expose a helper property.
@property(nonatomic, assign, readonly) BOOL hasMyObject
Which does
return self.myObject != nil;
I need…

Karmeye
- 1,399
- 1
- 8
- 16
0
votes
2 answers
Track NSManagedObject property when it was updated and immediately update view
I have a question how can I listen to changes in my data model.
I have NSManagedObject email with property progress. So while app is sending email, I every time update property progress.
I want to listen to data model and if changed update my…

Matrosov Oleksandr
- 25,505
- 44
- 151
- 277
0
votes
0 answers
How to observe swipe event (cell position) of a UITableViewCell by Key-Value-Observer
I have a UITableView and custom UITableViewCell. When I swipe the cell in order to delete it, I have to exactly get informed about the position of the cell (view) in order to adjust its content accordingly. Therefore, I planned to use the…

Morpheus78
- 870
- 1
- 9
- 21
0
votes
2 answers
Trying to implement Key-Value Observing for first time, get some error
I have trouble implementing a Key-Value Observer at my attempt to follow the MVC pattern. I have a controller class, a model class and a view class. I update my model from the controller class and I want to put a key value observer in my view class…

Sebastian L
- 924
- 2
- 10
- 20
0
votes
1 answer
MKMapAnnotationManager not removing itself as observer for MKAnnotation
I'm still working on this, but figured it was worth asking about:
I have a class that conforms to the MKAnnotation protocol called AMAnnotation. This class also implements setCoordinate:
- (void)setCoordinate:(CLLocationCoordinate2D)newCoordinate
{
…

Brian Toth
- 529
- 4
- 14
0
votes
2 answers
NSMutableDictionary setValue:forUndefinedKey
I'm developing an iOS app. I have a class that extends NSObject that defines 1 property
//.h file
@property (nonatomic,retain) NSMutableDictionary *livedata;
//.m file
if(self = [super init]){
self.livedata = [[NSMutableDictionary alloc]…

zanemx
- 59
- 1
- 5
0
votes
2 answers
Crash while de-registration for KVO
I am seeing some random crashes with my app (although not reproducible when I run through same steps). I am observing the contentOffset property of the scrollview to take some action when it changes.
But I am getting below exception (randomly) with…

Abhinav
- 37,684
- 43
- 191
- 309
0
votes
1 answer
Custom UITableViewCell subclass update when Core Data updates
I'm using a Core Data model to keep track of some assets and whether they are downloaded to show the download state in the UI. Similar to Spotify's desktop app when you have the + or x or checkmark depending on the state of the player.
I have a…

marisbest2
- 1,346
- 2
- 17
- 30
0
votes
1 answer
NSManagedObject subclass updating custom property - getting KVO errors
EDIT: figured out that the NSNumber was a bad type to bind to. Using NSString instead solved the problem
I have a ToDo entity which has a to-one relationship ("title") with the ToDoTitle entity, and the relationship in reverse("todos") is to-many .…

Z S
- 7,039
- 12
- 53
- 105
0
votes
1 answer
KVO nspopup selection for predicate
I am just learning KVO. This is my first time implementing it and I am getting rather confused trying to keep it all straight.
Right now I have a popupbutton that is connected to an arraycontroller whose content is supplied by a dictionary.
I…
user2638932
0
votes
1 answer
Can you KVO the property gestureRecognizers on a UIView?
I am creating a UIView that can alter the gestureRecognizers that are added to itself. Just to test it out I am adding a tap gesture right after adding the observer to trigger the KVO.
- (void)awakeFromNib
{
[self addObserver:self…

RantriX
- 1,017
- 1
- 10
- 18
0
votes
0 answers
Is "migrationProgress" really a getter of NSMigrationManager?
I just got core data migration working via NSMigrationManager. According to Apple doc:
migrationProgress Returns a number from 0 to 1 that indicates the
proportion of completeness of the migration.
- (float)migrationProgress
Return Value A number…

J-Q
- 374
- 5
- 15