Develop
2015.06.26 16:55
[ios] NSNotificationCenter 초간단 사용 예~ ㅋㄷ
Views 752 Comment 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]; }
No. | Category | Subject | Author | Date | Views |
---|---|---|---|---|---|
829 | Develop | 알고리즘 성능 분석 기준 | hooni | 2014.06.24 | 2902 |
828 | Develop |
아이 훌레시 작업중 ㅋㅋ
![]() |
hooni | 2013.08.09 | 0 |
827 | Develop | 서기의 PHP 동영상 강의(싱싱해) | hooni | 2013.05.15 | 31042 |
826 | Develop |
사이버보안실무 수업 메모
![]() |
hooni | 2017.03.23 | 0 |
825 | Develop |
사이버보안실무 발표자료 (2017.06.08)
![]() |
hooni | 2017.06.05 | 1326 |
824 | Develop |
베지어 곡선(Bézier curve) 알고리즘(spline 곡선)
3 ![]() |
hooni | 2013.04.23 | 33393 |
823 | Develop |
밸런싱 로봇.. 최종.. (관련 논문도 첨부) ㅋㅋ
![]() |
hooni | 2013.04.23 | 22865 |
822 | Develop |
모터에 대한 pid 제어.. ㅎㅎ
![]() |
hooni | 2013.04.23 | 18930 |
821 | Develop |
링크들 보고 지울 내용
![]() |
hooni | 2019.11.21 | 0 |
820 | Develop |
리팩토링 계획안
![]() |
hooni | 2017.05.15 | 851 |
819 | Develop |
레고 마인드스톰 NXT 수도쿠, 큐브 소스코드..
20 ![]() |
hooni | 2013.04.23 | 81534 |
818 | Develop |
레고 NXT 마인드스톰 밸런싱 로봇 ㅎㅎ
![]() |
hooni | 2013.04.23 | 57756 |