블럭으로 쌓인 코드가 실행 될 때 딜레이(?)가 발생하는 현상이 있는데
잘은 모르겠지만 큐에 들어갔다가 실행되어서 느리게 동작하는 것처럼 보이는듯 하다
정확한 이유 아시는분은 좀 알려주세요....
ACAccountStore * accountStore = [[ACAccountStore alloc] init];
ACAccountType * accountType = [accountStore accountTypeWithAccountTypeIdentifier:ACAccountTypeIdentifierTwitter];
//기존
[accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError * error){
........
....... 한박자 느리게 동작한다
}];
//수정
[accountStore requestAccessToAccountsWithType:accountType withCompletionHandler:^(BOOL granted, NSError * error){
dispatch_async(dispatch_get_main_queue(), ^{
........
....... 즉시 동작한다
});}];
'iPhone Dev' 카테고리의 다른 글
스크린샷 (0) | 2012.10.05 |
---|---|
빈프로젝트 뷰 연결 (0) | 2012.10.05 |
메모리와 스레드에 안전한 사용자정의 프로퍼티 메서드 만들기 (0) | 2012.10.05 |
리다이렉트된 웹페이지 (0) | 2012.10.05 |
xcode 4.2에서 파일 업로드 (0) | 2012.10.05 |