- (void)refresh:(id)sender{ [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(refreshFinished:) name:@"refresh.contacts" object:nil]; } -(void)refreshFinished{ }
出错
'NSInvalidArgumentException', reason: '-[ContactsViewController refreshFinished:]: unrecognized selector sent to instance 0xe65ccc0'
解决:
@selector(refreshFinished:) 去除":"即可
如果refreshFinished需要传参数,就需要加入":"