Tôi đã cố gắng hiển thị các bộ điều khiển xem được xác định hệ thống (MFMailComposeViewController, TWTweetComposeViewController, vv ..) dưới dạng chế độ xem phương thức.Không thể hiển thị ViewController phương thức trong iOS7
Nhưng những người kiểm tra chế độ xem này không xuất hiện trong iOS 7 (các ứng dụng này chạy trong iOS5, iOS6).
Chế độ xem được tạo bởi tôi xuất hiện trong iOS7 (ex.HogeViewController).
Tôi không gọi presentViewController:animated:completion
tại viewDidLoad
hoặc viewWillAppear
.
Có ai có ý tưởng không?
bản ghiConsole:
init Error Domain=NSCocoaErrorDomain Code=4097 "The operation couldn’t be completed. (Cocoa error 4097.)"
hoặc
_serviceViewControllerReady:error: Error Domain=NSCocoaErrorDomain Code=4097 "The operation couldn’t be completed. (Cocoa error 4097.)"
hoặc
Unbalanced calls to begin/end appearance transitions for .
TWTweetComposeViewController (không xuất hiện)
TWTweetComposeViewController *viewController = [[TWTweetComposeViewController alloc]init];
viewController.completionHandler = ^(TWTweetComposeViewControllerResult result){
NSLog(@"Result : %d",result);
};
[self presentViewController:viewController animated:YES completion:NULL];
Log
Result : 0
MFMailComposeViewController (xuất hiện trong chốc lát và bỏ sớm)
- (void)send:(NSString*)email{
if ([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
NSArray *toRecipients = @[email];
[picker setToRecipients:toRecipients];
[picker setSubject:@"Subject"];
[picker setMessageBody:@"Body" isHTML:NO];
[self.navigationController presentViewController:picker animated:YES completion:NULL];
}
}
- (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error {
[self dismissViewControllerAnimated:YES completion:^{
NSLog(@"error:%@,result:%d",error.description,result);
}];
}
Log
_serviceViewControllerReady:error: Error Domain=NSCocoaErrorDomain Code=4097 "The operation couldn’t be completed. (Cocoa error 4097.)" Unbalanced calls to begin/end appearance transitions for . error:(null),result:0
thú vị, c bạn vui lòng hiển thị mã của bạn không? – Woodstock
Cảm ơn bạn đã bình luận. Tôi đã chỉnh sửa câu hỏi. –
Bạn có thể thử đặt hoạt ảnh: không có chuyển tiếp không? – Woodstock