This repository was archived by the owner on May 28, 2025. It is now read-only.
Repository navigation
Support NSArray KVO for elements - #2204
Merged
Merged
Conversation
Dustin L. Howett (MSFT) (DHowett-MSFT)
suggested changes
Mar 9, 2017
|
|
||
| #define NS_COLLECTION_THROW_ILLEGAL_KVO(KEYPATH) \ | ||
| do { \ | ||
| [NSException raise:NSInvalidArgumentException format:@"%@ is not supported. Key path: %@", NSStringFromSelector(_cmd), KEYPATH]; \ |
There was a problem hiding this comment.
nit: no shouty KEYPATH.
Please add -[%hs %hs] with object_getClassName(self), sel_getName(_cmd); this will add the class (obvs.) and avoid the NSString intermediary for _cmd.
|
|
||
| #include <Foundation/NSEnumerator.h> | ||
|
|
||
| #define NS_COLLECTION_THROW_ILLEGAL_KVO(KEYPATH) \ |
There was a problem hiding this comment.
enumerator is an unusual header into which to put this
Contributor
Author
There was a problem hiding this comment.
I was looking for a shared internal place for the NS* classes where KVO is illegal. What's the reasonable place to stick this?
There was a problem hiding this comment.
Reckon we could go with NSKeyValueObserving-Internal.h, but iunno.
Dustin L. Howett (MSFT) (DHowett-MSFT)
approved these changes
Mar 14, 2017
Allen Ballway (aballway)
force-pushed
the
kvo
branch
from
March 15, 2017 18:49
4a49f60 to
a05c823
Compare
Contributor
Author
|
ping! |
Raj Seshasankaran (rajsesh)
approved these changes
Mar 23, 2017
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Causes an NSException to be thrown if addObserver:forKeyPath* or removeObserver:forKeyPath* are called on NSArray as per documentation.
Implements addObserver:toObjectsAndIndexes* and removeObserver:fromObjectsAtIndexes* for NSArray by calling addObserver and remvoeObserver on each specified element. Though documentation states that this method is not a simple convenience wrapper, we cannot do so because our current implementation of KVO cannot support a single observer intermediary for multiple observees without a larger refactor than this issue calls for.
Fixes #2068