0

안녕하세요. 저는 휴대 전화에서 iOS8 베타를 실행 중이며 마지막으로 내 전화를 업데이트 한 이후 UIAlertViews가 나타나지 않아서 문제가 발생합니다. 나는이 섹션에서 코드를 변경하지 않았으며 이전에는 잘 작동했다. 다음은 관련 코드입니다. 간단히 말해 웹 뷰를로드하고 인터넷에 연결되어 있지 않으면 연결이 없다는 경고를 표시해야합니다. 내가 Xcode5 가끔 내 코드와 공정한 재생되지 같은 느낌이 지금은 내가에만 실행할 수 MediaPlayer를 프레임 워크와는 오류가 말하고있는 것으로 나타났습니다로UIAlertView가 iOS8을 표시하지 않습니다.

- (void)viewDidLoad 
{ 
[super viewDidLoad]; 

    [[self view] setBackgroundColor:[UIColor colorWithRed:1.0f green:0.96f blue:0.33f  alpha:1.0]]; 
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.sheffski.co.uk/forum/"]]]; 
[webView addSubview:activityInd]; 
timer=[NSTimer scheduledTimerWithTimeInterval:(1.0/2.0) target:self selector:@selector(loading) userInfo:nil repeats:YES]; 
} 
-(void)loading{ 
if(!webView.loading) 
    [activityInd stopAnimating]; 
else 
    [activityInd startAnimating]; 
} 

- (void)didReceiveMemoryWarning 
{ 
[super didReceiveMemoryWarning]; 
// Dispose of any resources that can be recreated. 
} 
//No Internet Connection error code 
-(void)webView:(UIWebView *)WebView didFailLoadWithError:(NSError *)error { 
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error!" message:@"You have no internet connection! Reload the app with a connection or try another page." delegate:self cancelButtonTitle:@"Close App" otherButtonTitles:@"Continue", nil]; 
[alert show]; 

} 
- (void)alertView:(UIAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex { 
if(buttonIndex == 0){ 
    exit(0); 
} 

} 

불행하게도 나는 iOS7.1에 그것을 테스트 할 수 없습니다 Xcode6 베타 버전에서 (지금 7.1 시뮬레이터 다운로드). 코드에 본질적으로 문제가있는 것을 다른 사람이 볼 수 있는지 그리고 다른 사람들이이 문제를 겪고 있는지 궁금합니다.

답변

0

UIAlertController를 사용하십시오. UIAlertView는 iOS 8에서 더 이상 사용되지 않습니다.

관련 문제