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 docs for NSObject(BlockObservation) do not explicitely say that BlockObservers will be removed autamatically upon dealloction, but it is more or less implied in the following warning (at least for iOS 5 and newer):
Warning: Important: Due to a design flaw in some recent versions of the Objective-C runtime, you must call either a block overserver removal method in the dealloc method of any object making use of block-backed key-value observing. This has been fixed in the OS X 10.7 and iOS 5.0 runtime.
When running the following example on iOS6 however the observer is not actually removed:
An instance 0x9b47210 of class NSObject was deallocated while key value
observers were still registered with it. Observation info was leaked, and
may even become mistakenly attached to some other object. Set a breakpoint
on NSKVODeallocateBreak to stop here in the debugger.
Here's the current observation info:
<NSKeyValueObservationInfo 0x9b49b30> (
<NSKeyValueObservance 0x9b49950:
Observer: 0x9b47d90,
Key path: bar,
Options: <New: NO, Old: NO, Prior: NO>
Context: 0xc3fc4,
Property: 0xb01f270>
)
To clarify: the observee is deallocated correcty, the BKObserver instance is deallocated correctly, but the observation info remains in memory.
So, did I misunderstand the features of this category or is this a bug?
The text was updated successfully, but these errors were encountered:
The docs for NSObject(BlockObservation) do not explicitely say that BlockObservers will be removed autamatically upon dealloction, but it is more or less implied in the following warning (at least for iOS 5 and newer):
When running the following example on iOS6 however the observer is not actually removed:
This will generate the following log entry:
To clarify: the observee is deallocated correcty, the BKObserver instance is deallocated correctly, but the observation info remains in memory.
So, did I misunderstand the features of this category or is this a bug?
The text was updated successfully, but these errors were encountered: