을 실행 나는 다음과 같은 코드가 있습니다IOS : UIAlertView for 루프 직전 쇼
이UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Loading Content For the First Time..."
message:@"\n"
delegate:self
cancelButtonTitle:nil
otherButtonTitles:nil];
UIActivityIndicatorView *spinner = [[UIActivityIndicatorView alloc] initWithActivityIndicatorStyle:UIActivityIndicatorViewStyleWhiteLarge];
spinner.center = CGPointMake(139.5, 75.5); // .5 so it doesn't blur
[alertView addSubview:spinner];
[spinner startAnimating];
[alertView show];
for (TCMLevelRemote *level in [obj objectForKey:@"levels"]){
[[TCMExhibitFeedStore sharedStore] createLevel:level];
}
[[TCMExhibitFeedStore sharedStore] loadAllLevels];
[[TCMExhibitFeedStore sharedStore] setAllLevels:[[TCMExhibitFeedStore sharedStore] storedLevels]];
[alertView dismissWithClickedButtonIndex:0 animated:YES];
(가) 루프가 처음으로 응용 프로그램 실행에 대한 몇 가지 정보를 내려 받고 실행하는 데 시간이 걸립니다. 따라서 사용자가 응답하지 않는 화면에서 기다리지 않아도되도록이 알림을 표시하고 싶습니다. 문제는 for 루프가 끝날 때까지 alertview가 표시되지 않는다는 것입니다. 그런 다음 곧바로 사라집니다. 무엇을 바꾸어야합니까?
가장 좋은 옵션 인 CGD +1,'performSelector'을 무시/제거 할 수 있습니다 :)) – danypata
네가 맞다 CGD는 우리 중 가장 훌륭하다 ... :) –