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
torchLevel KVO - iOS
I am using AVFoundation in iOS to manipulate the torch on an iPhone 6. I need to know the current torch level.
I've read in AppleDevLib that it's possible to observe the current torch level using KVO, but I've failed to implement that.
Can you put…

Miki Stuchlej
- 147
- 2
- 7
0
votes
2 answers
I can't observe the progress value of UIProgressView with KVO when I use the -setProgress:animated:
I have set
[self.progressView addObserver:self forKeyPath:@"progress" options:NSKeyValueObservingOptionNew context:nil];
if I use self.progressView.progress = 0.1; to change progress, it's ok.
but if I use [self.progressView setProgress:0.1…

Vincent
- 141
- 1
- 2
- 15
0
votes
2 answers
Key value Observer is not getting called when there is a change in property in cocoa
I had 2 Objects Obj1 and Obj2. Where Obj1 is having a property isLocalChanges(BOOL) to check for any local changes made. I need to observe the change for this isLocalChanges if there is any changes I am setting the value to YES.
I written an…

Monish Kumar
- 2,788
- 4
- 38
- 54
0
votes
1 answer
Can KVO be used to deeply observe variable collections?
I get how to use K-V-O for simple property stuff. I have a model that looks like
@interface WateringScript : NSObject
@property (strong, nonatomic) NSMutableArray* spans; // holds WateringSpans
...
@end
@interface WateringSpan : NSObject
@property…

Travis Griggs
- 21,522
- 19
- 91
- 167
0
votes
1 answer
Core Data: best way of checking the uniqueness of an attribute
As far as I know, there is no way of setting an entity's attribute as unique through Core Data, neither programmatically nor in Xcode's editor... I need to make sure that certain managed objects can't be created if there are collisions with the…

AppsDev
- 12,319
- 23
- 93
- 186
0
votes
2 answers
View Key value observations
How do I know what items my object is key-value observing?
The only way I've been able to find out if I'm already observing is to try to remove the observation. If an exception is thrown, then I wasn't observing.
for (AVPlayerItem *item in…

quantumpotato
- 9,637
- 14
- 70
- 146
0
votes
1 answer
KVO says that a KVO observer is registered even though it is not (or is it?)
When my application is closed, the main controller class removes itself as Observer from the model and then releases the model. Like this:
- (void)dealloc {
[theModel removeObserver:self
forKeyPath:@"myValue"];
[theModel…

bastibe
- 16,551
- 28
- 95
- 126
0
votes
0 answers
Notify when device date enters a date range on iOS
I'm trying to figure out if there's a way to track if the current device date is within a specific time range and get notified.
Example:
Say I have a start time of December 2, 2014 at 11AM and an end time of December 2,2014 at 1PM. I want to…

user754905
- 1,799
- 3
- 21
- 29
0
votes
1 answer
Key Value Observe static NSDictionary on facade class
I have a ServiceFacade class with class methods for communicating with backend services.
On that ServiceFacade class I have a static method that returns NSMutableDictionary in which I keep current ServiceFacade's downloading operations.
I want to…

zevonja
- 193
- 1
- 14
0
votes
2 answers
iOS UIWebView disappears after loading
I'm trying to figure out how to troubleshoot and/or solve an issue where a UIWebView clearly loads but then disappears.
After tracing in the debugger, the webView is disappearing after viewDidAppear:
The content flashes briefly on screen and is then…

kraftydevil
- 5,144
- 6
- 43
- 65
0
votes
0 answers
Cocoa bindings to one window with IBAction and IBOutlet in different classes
I am trying to implement an IBAction in one class (SuperDel) and access IBOutlet in another class (SubC).
The class method subMethod is suppose to change the value of NSString testin the viewer via KVC/KVO .
From the Object Library in Xcode I have…

userjuicer
- 123
- 2
- 9
0
votes
1 answer
Ember Binding or Observable to Null Out Other Value When Set
I have two properties in my user model school_id and school_name because I allow users to specify their own school if the list I provide is not enough. This should be universal to a User. The Ember documention seemingly suggests bindings but only…

Michael
- 1,786
- 5
- 23
- 42
0
votes
1 answer
KVO exc_bad_access (code=1)
- (void)setTableView:(UITableView *)tableView {
_tableView = tableView;
[_tableView addObserver:self
forKeyPath:@"frame"
options:0
context:nil];
[self updateFrame];
}
The exc_bad_access…

riven
- 73
- 9
0
votes
2 answers
KVO notifications on NSArray arrayByAddingObjectsFromArray
I'm building an array via a block call and want to use it to populate cells of a UITableView. I'm trying to use KVO to listen to the changes to the array but I can't find a way to target it.
This is a bit dated, but it says that…

SirJay
- 119
- 4
- 8
0
votes
1 answer
How to view and debug active key value observers
Typical story... inherited a buggy app from a coder that left a year ago.
App uses some funky transition plugins; namely, iCarousel, MPFFlipTransition.
App pops separate browser tabs.
Error is thrown when the browser or a browser tab is…

kmiklas
- 13,085
- 22
- 67
- 103