我用NSNotificationCenter:NSNotification - 觀察者不匹配
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(playNow:) name:@"PlayNow" object:nil];
和郵政業:
[[NSNotificationCenter defaultCenter] postNotificationName:@"PlayNow" object:nil userInfo:noteInfoDictionary];
其中自是@interface MyPlayer : NSObject
例如當我把它與大多數情況下的偉大工程,但是當我dealloc和撥回MyPlayer實例我得到這個錯誤:
*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIView playNow:]: unrecognized selector sent to instance 0x8929150'
如何從UIView中獲取錯誤?
您是否在刪除dealloc中的觀察者?如果沒有,你應該。 – rdelmar
是的,這是問題所在。 – Kuba