我使用 NSNotificationCenter:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playNow:) name:@"PlayNow" object:nil];
和发布:
[[NSNotificationCenter defaultCenter] postNotificationName:@"PlayNow" object:nil userInfo:noteInfoDictionary];
其中 self 是@interface MyPlayer : NSObject
当我调用它时,它在大多数情况下都很好用,但是当我释放并分配回 MyPlayer 实例时,我收到了这个错误:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView playNow:]: unrecognized selector sent to instance 0x8929150'
我怎么可能从 UIView 收到错误?