NSURL *url = [NSURL URLWithString:@"valid_webcal_url"];
if (![[UIApplication sharedApplication] openURL:url])
{
// failure callback
NSLog(@"%@%@",@"Failed to open url:",[url description]);
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:LCHLocalizedString(@"SUBSCRIBE_ERROR", nil) message:nil delegate:self cancelButtonTitle:@"Okay" otherButtonTitles: nil];
[alert show];
}
그래서 webcal을로드하는 중에 오류가 있는지 확인하는 방법을 알아 냈습니다. 그러나 webcal이 성공적으로로드 된시기를 어떻게 알 수 있습니까? "subscribe"버튼을 누를 때 로더를 표시하고 언제 꺼야하는지 알아야합니다.ios webcal request - 완료 콜백?
가난한 NSLog()를 강간하는 이유는 무엇입니까? 형식 문자열은 상수 부분을 포함 할 수 있으며 NSLog (@ "URL을 열 수 없음 : % @", url);은 ** 읽기 쉽습니다 ** –
어쨌든 openURL을 사용하여 앱을 백그라운드에 두지 않습니까? – Mundi
분명히 webcal 프로토콜을 사용할 때 그렇지 않습니다. 펑키, 나도 알아,하지만 당신의 의견은 내가 실행할 수있는 해결책을 찾도록 도왔다. – Jacksonkr