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

Attempting to get auto layout values with nil engine

I'm using auto layout in my project and I get the following message in the console window: Attempting to get auto layout values with nil engine. Affected view: This happens if I try to update my view hierarchy in…
Marcin Kuptel
  • 2,674
  • 1
  • 17
  • 22
0
votes
1 answer

can not receive notification of change, key value observing, KVO model-IOS

Im registering an observer for on of my class named myClassA ( subclass of uiview ) from one of my class named UIScrollView(Sample)( a category for uiscroll view ) @implementation UIScrollView (myClass) // Register an observer -…
tranvutuan
  • 6,089
  • 8
  • 47
  • 83
0
votes
1 answer

Loading of different views in a single custom view based on buttons in those Custom views

In my project I have only one window, in that window I have only one Custom view, nothing other than that. In that custom view I am loading one Default view, and in that default view I have one Button over there. When that button IBAction is…
0
votes
1 answer

Error on creating a KVO on a UIView

I am adding a UIView called bookViewContainer to my view controller, and I want to detect when its scale changes using KVO. Here is my viewDidLoad: - (void)viewDidLoad { [super viewDidLoad]; bookViewContainer = [[UIView alloc]…
jowie
  • 8,028
  • 8
  • 55
  • 94
0
votes
2 answers

Stopping a loop

As explained in my earlier question … This code … - (void)syncKVO:(id)sender { NSManagedObjectContext *moc = [self managedObjectContext]; [syncButton setTitle:@"Syncing..."]; NSString *dateText = (@"Last Sync : %d", [NSDate date]); …
Joshua
  • 15,200
  • 21
  • 100
  • 172
0
votes
1 answer

How to notify parent class from child?

I'm trying to resolves one architectural issue, but I want to find best suitable approach. I have game scene GameLayer.h which is my view in this case. I have also GameEngine class which I'm trying to be controller. I have my custom Egg class…
0
votes
1 answer

Is -dealloc too late for unregistering from KVO

I'm having a model object, a direct NSObject subclass, whose properties are observed by a context object using KVO. I'm unregistering from KVO in the dealloc of the model object like this: - (void) dealloc { [self.context…
0
votes
1 answer

Core Data Cache NSSet Properties

Not sure my title best describes my question but couldn't think of a better one! I have 2 Managed Objects, 'Transaction' and 'Split'. Transaction has a 1 to many relationship with 'Split' and therefore has an NSSet of Split Objects. Split has 2…
0
votes
2 answers

Key-Value Observing with NSMutableData iOS

In my model I have NSMutableData Object called data. I want to observe it from another object and get a notification when data is added or removed. I understand that this is a to-many relationship, so I can't use the normal KVO by first adding the…
Jim Craane
  • 186
  • 3
  • 10
0
votes
2 answers

Why do KVO observers see an empty NSKeyValueChangeNewKey when observing an unordered to-many relationship?

There is a property on a UIViewController subclass that changes when a view becomes visible. (A set stops being empty.) I've implemented KVC/KVO as follows: - (void)viewWillAppear:(BOOL)animated { [self…
Sam
  • 378
  • 3
  • 9
0
votes
3 answers

Updating UIView subclass when its property (model) changes

I have a UIView subclass CustomView that has a property CustomObject *model, as well as a couple IBOutlet properties. CustomObject has two properties, an NSString *title and NSString *imageName. I would like an easy, extensible way to update…
Ned
  • 6,280
  • 2
  • 30
  • 34
0
votes
2 answers

iPhone Key-Value Observer: observer not registering in UITableViewController

Hi Fellow iPhone Developers, I am an experienced software engineer but new to the iPhone platform. I have successfully implemented sub-classed view controllers and can push and pop parent/child views on the view controller stack. However, I have…
0
votes
1 answer

Any way to see who is triggering changes re: key value observing?

I'm using key value observing to perform specific actions whenever certain properties are changed (e.g., relayout subviews of a custom UIView whenever its frame or bounds change). Is there any way to see who (i.e., what function) is triggering this…
0
votes
1 answer

UITableView reloads row with unwanted fade when previous section is hidden

I have a UITableViewController that displays properties of an NSManagedObject in a grouped tableView. The values of those properties can be changed from custom UITableViewCell subclasses that have UISteppers and UITextFields. The table normally has…
0
votes
2 answers

iOS - How to remove observer from singleton NSObject for KVO?

I have a shared singleton class of NSObject that I have some operation queues running in. I get a crash on this: [super observeValueForKeyPath:keyPath ofObject:object change:change context:context]; It seems that I need to use 'removeObserver:' to…
JimmyJammed
  • 9,598
  • 19
  • 79
  • 146