Develop
2015.06.26 16:55
[ios] NSNotificationCenter 초간단 사용 예~ ㅋㄷ
조회 수 659 댓글 0
Notification 날릴 때,
//Dictionary 만들어서 사용할 경우.. NSDictionary *infoData = [NSDictionary dictionaryWithObjectsAndKeys:missionIdString, @"missionId", winYNString, @"winYNString", str1String, @"str1String", str2String, @"str2String", callbackString, @"callbackString", nil]; [[NSNotificationCenter defaultCenter] postNotificationName:@"NotificationLoadedBenefitView" object:nil userInfo:infoData]; // 또는 한번에.. ㅋㄷ [[NSNotificationCenter defaultCenter] postNotificationName:@"NotificationLoadedBenefitView" object:nil userInfo:@{@"missionId":missionIdString, @"winYNString": winYNString, @"str1String": str1String, @"str2String": str2String, @"callbackString": callbackString}];
Notification 받는 방법과 처리하는 메소드(selector)
// Notification 처리 메소드 - (void)updateBenefitView:(NSNotification *)notification { self.isWithCallback = YES; [self viewMissionResult:notification]; NSDictionary *dict = [notification userInfo]; NSString *callbackString = [dict objectForKey:@"callbackString"]; [self performSelector:@selector(execCallback:) withObject:callbackString afterDelay:1.0]; } // Notification 옵저버 - (void)viewDidLoad { [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(updateBenefitView:) name:@"NotificationLoadedBenefitView" object:nil]; } // Notification 제거 - (void)dealloc { [[NSNotificationCenter defaultCenter] removeObserver:self]; }
-
[node.js] nodejs 기본 설치
-
[node.js] 지금 하고 있는거..
-
[iphone] 파일 업로드 샘플 코드 ㅎㅎ
-
[js] JSON 컨트롤.. 재귀호출로 값 출력하기
-
[js] 모바일웹에서 이미지 저장하는거 (context menu) 막기
-
[android] keytool을 사용하여 키스토어 생성
-
[js]모바일 웹에서 orientationchange
-
맥에서 파일공유 (윈도우,맥)
-
[mysql] mysql user 생성시 ERROR 1364
-
Mac OS X - Apache+PHP+MySQL 환경 서버
-
영어공부에 도움될만한 사이트 모음
-
서기의 PHP 동영상 강의(싱싱해)