1

I'm using a UIPopoverController to display some content, and I wanted to use KVO to observe the popoverVisible property. Unfortunately it seems that UIPopoverController isn't KVO compliant.

Could anyone shed some light into why this is the case? Is there some way to subclass UIPopoverController and make its popoverVisible property KVO? I feel like this won't necessarily work if Apple's code is changing the instance variable directly rather than via a property.

bradley.ayers
  • 37,165
  • 14
  • 93
  • 99
  • possible duplicate of [How reliable is KVO with UIKit](http://stackoverflow.com/questions/6114261/how-reliable-is-kvo-with-uikit) – outis Jul 19 '12 at 03:04

1 Answers1

3

Actually, it's not just UIPopoverController. Most of UIKit is not KVO-compliant. Instance variables are directly set often. Unfortunately, there's really nothing you can do about it except file a bug requesting KVO support.

BJ Homer
  • 48,806
  • 11
  • 116
  • 129
  • Do you have any idea *why* this is the case? Do most of these APIs pre–date KVO? Or is there some performance penalty that makes it worth omitting? – bradley.ayers Jul 19 '12 at 02:17
  • I found http://stackoverflow.com/questions/6114261/how-reliable-is-kvo-with-uikit is related, thanks for putting me on the right track. – bradley.ayers Jul 19 '12 at 02:22