This repository was archived by the owner on Mar 3, 2020. It is now read-only.

Description
System version less than iOS 11
[self.KVOControllerNonRetaining observe:self keyPath:@"name" options:NSKeyValueObservingOptionNew | NSKeyValueObservingOptionOld block:^(id _Nullable observer, id _Nonnull object, NSDictionary<NSString *,id> * _Nonnull change) {
NSLog(@"xly--%@",change);
}];
- (void)dealloc {
NSLog(@"xly--%@",@"dealloc");
[self.KVOControllerNonRetaining unobserveAll];
}
pop crash
2018-10-17 14:40:41.390 TestField[71971:8049984] xly--dealloc
2018-10-17 14:40:45.767 TestField[71971:8049984] *** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'An instance 0x7fa168e04230 of class TestViewController was deallocated while key value observers were still registered with it. Current observation info: <NSKeyValueObservationInfo 0x60000003a4c0> (
<NSKeyValueObservance 0x608000244470: Observer: 0x60800009bda0, Key path: name, Options: <New: YES, Old: YES, Prior: NO> Context: 0x60800007ffc0, Property: 0x6080002422e0>
)'