You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 2, 2018. It is now read-only.
The NSObject+BlockObservation.h header contains the following warning near the top:
@warningImportant: Due to a design flaw in some recent versions of the
Objective-C runtime, you must call removeObserverWithBlockToken: in the
dealloc method of any object making use of block-based KVO.
This refers to a method that doesn't exist in the current implementation (-removeObserverWithBlockToken:).
Is this warning still relevant? Does it mean that -removeAllBlockObservers can not be relied upon? If so, maybe the warning should be added to that method? Or maybe the -removeAllBlockObservers method should be deprecated/removed if it does not work on some OS versions?
The text was updated successfully, but these errors were encountered:
Ah, no, whoops, I'll clarify that behavior in the future. All removal methods, -removeObserverForKeyPath:identifier:, -removeAllBlockObservers, and the future -removeObserversWithIdentifier:, work perfectly on every OS version.
Since iOS 3.1, we've had the runtime feature of associated objects, which BlocksKit uses to implement many features from within categories. The runtime is supposed to remove/release all associated objects on deallocation, obviating the need to call a block KVO removal method unless you want to. However, due to a bug in the runtimes of iOS 4.x and OS X 10.6, this occasionally doesn't happen when the associated object is hooked in to KVO. In other words, in a BlocksKit-based application supporting OS X 10.6 or iOS 4.x, we recommend manually removing block observers to prevent memory leaks and/or crashes.
The NSObject+BlockObservation.h header contains the following warning near the top:
This refers to a method that doesn't exist in the current implementation (-removeObserverWithBlockToken:).
Is this warning still relevant? Does it mean that -removeAllBlockObservers can not be relied upon? If so, maybe the warning should be added to that method? Or maybe the -removeAllBlockObservers method should be deprecated/removed if it does not work on some OS versions?
The text was updated successfully, but these errors were encountered: