Tôi gặp vấn đề tương tự như bạn. Đây là một vấn đề iOS 5. Đó là vì ShareKit đang sử dụng phương thức trên UIViewController
được gọi là parentViewController
và theo tài liệu của Apple, bạn không thể sử dụng phương thức này trong iOS 5. Thay vào đó, bạn phải sử dụng presentingViewController
.
Vì vậy, để khắc phục nó trong mã ShareKit, đi vào SHK.m, tìm ra phương pháp có chữ ký (void)hideCurrentViewControllerAnimated:(BOOL)animated
, và thay thế bằng:
- (void)hideCurrentViewControllerAnimated:(BOOL)animated
{
if (isDismissingView)
return;
if (currentView != nil)
{
// Dismiss the modal view
if ([currentView parentViewController] != nil)
{
self.isDismissingView = YES;
[[currentView parentViewController] dismissModalViewControllerAnimated:animated];
} else if ([currentView presentingViewController] != nil) {
self.isDismissingView = YES;
[[currentView presentingViewController] dismissModalViewControllerAnimated:animated];
} else
self.currentView = nil;
}
}
này làm việc cho tôi trên iOS 5.
Nguồn
2011-10-31 20:22:47
Đây là giải pháp tôi thực hiện cũng như –
y nó đang thay đổi hướng của thiết bị – WaaleedKhan