문제

In my app , i am using iCloud.

I want to show UIActivityIndicatorView when loading iCloud Document into my UITextView and after finished i want to hide UIActivityIndicatorView.

How can i check iCloud Document Loading and finished to show UIActivityIndicatorView?

Here is my code to load iCloud document into my UITextView.

[doc openWithCompletionHandler:^(BOOL success) {
                if(success)
                {
                    self.txtView.text = self.doc.noteContent;
                }

                else
                {
                    NSLog(@"Error");
                }
            }];
도움이 되었습니까?

해결책

This is as simple as:

[self.myActivityIndicator startAnimating];
[doc openWithCompletionHandler:^(BOOL success) {
            [self.myActivityIndicator stopAnimating];
            if(success)
            {
                self.txtView.text = self.doc.noteContent;
            }

            else
            {
                NSLog(@"Error");
            }
        }];
라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top