1
내가 알림을 게시 메시지에 작용하지 메소드 이 호출됩니다.NSNotificationCenter 내 클래스 중 하나에서
통지를 보내지 만 메소드가 호출되지 않습니다.
NSNotification
에 대해 알아야 할 것이 있습니까? 저 성질인가요?
내가 알림을 게시 메시지에 작용하지 메소드 이 호출됩니다.NSNotificationCenter 내 클래스 중 하나에서
통지를 보내지 만 메소드가 호출되지 않습니다.
NSNotification
에 대해 알아야 할 것이 있습니까? 저 성질인가요?
do this changes
[[NSNotificationCenter defaultCenter] postNotificationName:@"ALERTNOTI" object:nil];
if you want to pass some object through the notification. then do this
ex: you want to pass an NSDictionary *dict
[[NSNotificationCenter defaultCenter] postNotificationName:@"ALERTNOTI" object:nil userInfo:dict];
알림을 통해 호출하려는 메소드는 다음과 같아야합니다.
-(void)method:(NSNotification *) notif
{
// your code here.
//if you want to access your dict
NSDictionary *myDict=[notif userInfo];
}
이 시도 :
[[NSNotificationCenter defaultCenter] postNotificationName:@"ALERTNOTI" object:nil];
을 위의 대답은 올바른 표시가 당신에게 tick..thank 경우 –