- (void)dealloc {
@try {
[ removeObserver:self forKeyPath:@"frame"];
}
@catch(NSException *exception) {
NSLog(@"--%@", exception);
}
}
注意:
我并没有在当前类里添加的属性frame的KVO监听,直接移除的,这么写就不会导致崩溃
- (void)dealloc {
@try {
[ removeObserver:self forKeyPath:@"frame"];
}
@catch(NSException *exception) {
NSLog(@"--%@", exception);
}
}
我并没有在当前类里添加的属性frame的KVO监听,直接移除的,这么写就不会导致崩溃