티스토리 뷰
NSNotificationCenter *nc = [NSNotificationCenter defaultCenter];
- Notification 받기
[nc addObserver:self selector:@selector(myMethod:) name:@"myNotiName" object:nil];
- Notification 날리기
[nc postNotificationName:@"myNotiName" object:self userInfo:nil];
- Notification 해제
[nc removeObserver:self name:@"myNotiName" object:nil];
메소드 선언은 다음과 같이
- Notification 받기
[nc addObserver:self selector:@selector(myMethod:) name:@"myNotiName" object:nil];
- Notification 날리기
[nc postNotificationName:@"myNotiName" object:self userInfo:nil];
- Notification 해제
[nc removeObserver:self name:@"myNotiName" object:nil];
메소드 선언은 다음과 같이
-(void)myMethod:(NSNotification *)noti{
NSString *stringValue = [[noti userInfo] objectForKey:@"inputKey"];
}
값담기
NSDictionary *dic = [NSDictionary dictionaryWithObject:_textField.text forKey:@"key"];
가져올땐
NSString *text = [[note userInfo] objectForKey:@"key"];
'나름 프로그래밍? > Objective-C' 카테고리의 다른 글
libxml 헤더 포함하기 (0) | 2010.05.12 |
---|---|
ApplicationDelegate 참조 얻어오기 (0) | 2010.05.12 |
respondsToSelector (0) | 2010.04.26 |
현재 시각 가져오기 (0) | 2010.04.22 |
CATransition (0) | 2010.04.22 |