forked from nolanw/HTMLReader
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement -addChild: and -removeChild: as conveniences on HTMLNode.
Turns out adding an object already in the ordered set calls the KVC method -insertObject:inChildrenAtIndex: with an index one beyond the last index. An NSMutableOrderedSet is documented to do nothing when -addObject: is called with an already-present object. However, by blindly passing along -insertObject:atIndex: to the underlying NSMutableOrderedSet, the object was silently *removed* from the set of children. So now we check for the object's presence and correctly do nothing when it's already present. Closes nolanw#57.
- Loading branch information
Showing
3 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
This file contains 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