티스토리 뷰

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];

메소드 선언은 다음과 같이

-(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
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/02   »
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28
글 보관함