轉換的JSON的字典,然後在該通知將其作爲用戶信息:
NSDictionary *quickDict = [NSDictionary dictionaryWithObjectsAndKeys:object1, key1, nil];
NSNotification* notification = [NSNotification notificationWithName:kVideoDidFinishNotification object:self userInfo:quickDict];
[[NSNotificationCenter defaultCenter] postNotification:notification];
我不知道如何使videoPlayBackDidFinish是消息的接收器,而無需在委託做這樣的事情:
[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(videoPlayBackDidFinish:) name:kVideoDidFinishNotification object:nil];
,然後在方法獲取到字典:
-(void)videoPlayBackDidFinish: (NSNotification*)notification
{
NSDictionary *jsonInfo = [notification userInfo];
}
我不同意正在關閉的問題!我確切地知道他在問什麼,以及如何回答他是否需要添加「我可以」而不是「我想要」? – badweasel 2013-03-16 09:48:32