I have used UIDocumentInteractionController for sharing the files but it open menu options after 25 seconds in iOS 8 beta 5 and works fine in iOS 7.1.
我已经使用UIDocumentInteractionController来共享文件,但是在iOS 8 beta 5中它在25秒后打开菜单选项,并且在iOS 7.1中工作正常。
I have verified the log which I pasted below
我已经验证了我粘贴在下面的日志
Errors encountered while discovering extensions: Error Domain=PlugInKit Code=13 "query cancelled" UserInfo=0x79bd5ef0 {NSLocalizedDescription=query cancelled}
2014-08-27 15:02:05.634 Localwire[82067:1364165] Unknown activity items supplied: (
{
"com.microsoft.excel.xls" = <d0cf11e0 a1b11ae1 00000000 00000000 00000000 00000000 3e000300 feff0900 06000000 00000000 00000000 10000000 01000000 00000000 00100000 cb070000 01000000 feffffff 00000000 00000000 62000000 e3000000 64010000 e5010000 66020000 e7020000 68030000 e9030000 6a040000 eb040000 6c050000 ed050000 6e060000 ef060000 70070000 ffffffff ffffffff ffffffff ffffffff ffffffff ffffffff
Im not sure what's the problem is.
我不确定问题是什么。
5 个解决方案
#1
3
UIActivityViewController is very fast in iOS 8. However you can't open images in other 3rd party applications like Instagram, Vintiqu, and so forth.
UIActivityViewController在iOS 8中非常快。但是你无法在Instagram,Vintiqu等其他第三方应用程序中打开图像。
Also, presentOpenInMenuFromRect is really faster than presentOptionsMenuFromRect in iOS 8 (iOS 8.0.2 too). But, presentOpenInMenuFromRect does not show sharing actions.
此外,presentOpenInMenuFromRect实际上比iOS 8中的presentOptionsMenuFromRect更快(iOS 8.0.2也是如此)。但是,presentOpenInMenuFromRect不显示共享操作。
I want to provide users with "Save Image, Assign to Contact, Copy, Print, ..." on the sharing view. So, my current workaround is just as below, :(
我想在共享视图上为用户提供“保存图像,分配给联系人,复制,打印......”。所以,我目前的解决方法如下:(
if( SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
[self.udic presentOpenInMenuFromRect:CGRectMake(self.view.frame.size.width/2 - 49/2, self.view.frame.size.height-49, 49, 49) inView:self.view animated:YES];
} else {
[self.udic presentOptionsMenuFromRect:CGRectMake(self.view.frame.size.width/2 - 49/2, self.view.frame.size.height-49, 49, 49) inView:self.view animated:YES];
}
#2
2
I have used UIActivityViewController
which didn't shown up any problem. This bug is still present in iOS 8 Release version
我使用过没有出现任何问题的UIActivityViewController。 iOS 8发行版中仍然存在此错误
So I'm going with UIActivityViewController
fix.
所以我要使用UIActivityViewController修复。
I have used TYOpenInAppActivity
to show the third party apps in UIActivityViewController
我使用TYOpenInAppActivity在UIActivityViewController中显示第三方应用程序
NSURL *URL = [NSURL fileURLWithPath:filePath];
TTOpenInAppActivity *openInAppActivity = [[TTOpenInAppActivity alloc] initWithView:self.view andBarButtonItem:barButton];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[URL] applicationActivities:@[openInAppActivity]];
// Create pop up
self.activityPopoverController = [[UIPopoverController alloc] initWithContentViewController:activityViewController];
// Store reference to superview (UIPopoverController) to allow dismissal
openInAppActivity.superViewController = self.activityPopoverController;
// Show UIActivityViewController in popup
[self.activityPopoverController presentPopoverFromRect:((UIButton *)sender).frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
You can find the TTOpenInAppActivity controller in below link.
您可以在下面的链接中找到TTOpenInAppActivity控制器。
https://github.com/honkmaster/TTOpenInAppActivity
https://github.com/honkmaster/TTOpenInAppActivity
#3
1
My workaround so far is to use presentOpenInMenuFromRect
instead of presentOptionsMenuFromRect
, this will show less items but at least it's not causing memory issues. QuickLook option seems to be buggy under iOS 8 beta 5 as well, pdf quick look is not working either, beside movie memory issues.
到目前为止我的解决方法是使用presentOpenInMenuFromRect而不是presentOptionsMenuFromRect,这将显示更少的项目,但至少它不会导致内存问题。在iOS 8 beta 5下,QuickLook选项似乎也有问题,除了电影内存问题之外,pdf快速查看也不起作用。
#4
1
Simple solution: keep the UIDocumentInteractionController
as View Controller variable (property or instance var) and init it inside viewDidLoad
(in my case I initialized it without any parameters). If the fileURL you want to open is dynamically changes, simply change UIDocumentInteractionController.URL
property before presenting.
简单的解决方案:将UIDocumentInteractionController保持为View Controller变量(属性或实例var)并在viewDidLoad中初始化它(在我的情况下,我在没有任何参数的情况下初始化它)。如果要打开的fileURL是动态更改的,只需在呈现之前更改UIDocumentInteractionController.URL属性。
#5
0
I am running into this with UIActivityViewController
, when passing in a dictionary of NSData
items that represent PNG
images.
当我传入代表PNG图像的NSData项目字典时,我正在使用UIActivityViewController进行此操作。
I was able to speed up the rendering of the action sheet by converting the NSData
objects to UIImage
instances in the activityViewControllerPlaceholderItem:
method.
通过在ActiveViewControllerPlaceholderItem:方法中将NSData对象转换为UIImage实例,我能够加快动作表的呈现速度。
- (id)activityViewControllerPlaceholderItem:(UIActivityViewController *)activityViewController {
NSMutableDictionary *itemPlaceholders = [NSMutableDictionary dictionary];
[self.items enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSData *obj, BOOL *stop) {
UIImage *placeholderImage = [UIImage imageWithData:obj scale:.5];
[itemPlaceholders setObject:placeholderImage forKey:key];
}];
return itemPlaceholders;
}
#1
3
UIActivityViewController is very fast in iOS 8. However you can't open images in other 3rd party applications like Instagram, Vintiqu, and so forth.
UIActivityViewController在iOS 8中非常快。但是你无法在Instagram,Vintiqu等其他第三方应用程序中打开图像。
Also, presentOpenInMenuFromRect is really faster than presentOptionsMenuFromRect in iOS 8 (iOS 8.0.2 too). But, presentOpenInMenuFromRect does not show sharing actions.
此外,presentOpenInMenuFromRect实际上比iOS 8中的presentOptionsMenuFromRect更快(iOS 8.0.2也是如此)。但是,presentOpenInMenuFromRect不显示共享操作。
I want to provide users with "Save Image, Assign to Contact, Copy, Print, ..." on the sharing view. So, my current workaround is just as below, :(
我想在共享视图上为用户提供“保存图像,分配给联系人,复制,打印......”。所以,我目前的解决方法如下:(
if( SYSTEM_VERSION_GREATER_THAN_OR_EQUAL_TO(@"8.0")) {
[self.udic presentOpenInMenuFromRect:CGRectMake(self.view.frame.size.width/2 - 49/2, self.view.frame.size.height-49, 49, 49) inView:self.view animated:YES];
} else {
[self.udic presentOptionsMenuFromRect:CGRectMake(self.view.frame.size.width/2 - 49/2, self.view.frame.size.height-49, 49, 49) inView:self.view animated:YES];
}
#2
2
I have used UIActivityViewController
which didn't shown up any problem. This bug is still present in iOS 8 Release version
我使用过没有出现任何问题的UIActivityViewController。 iOS 8发行版中仍然存在此错误
So I'm going with UIActivityViewController
fix.
所以我要使用UIActivityViewController修复。
I have used TYOpenInAppActivity
to show the third party apps in UIActivityViewController
我使用TYOpenInAppActivity在UIActivityViewController中显示第三方应用程序
NSURL *URL = [NSURL fileURLWithPath:filePath];
TTOpenInAppActivity *openInAppActivity = [[TTOpenInAppActivity alloc] initWithView:self.view andBarButtonItem:barButton];
UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[URL] applicationActivities:@[openInAppActivity]];
// Create pop up
self.activityPopoverController = [[UIPopoverController alloc] initWithContentViewController:activityViewController];
// Store reference to superview (UIPopoverController) to allow dismissal
openInAppActivity.superViewController = self.activityPopoverController;
// Show UIActivityViewController in popup
[self.activityPopoverController presentPopoverFromRect:((UIButton *)sender).frame inView:self.view permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES];
You can find the TTOpenInAppActivity controller in below link.
您可以在下面的链接中找到TTOpenInAppActivity控制器。
https://github.com/honkmaster/TTOpenInAppActivity
https://github.com/honkmaster/TTOpenInAppActivity
#3
1
My workaround so far is to use presentOpenInMenuFromRect
instead of presentOptionsMenuFromRect
, this will show less items but at least it's not causing memory issues. QuickLook option seems to be buggy under iOS 8 beta 5 as well, pdf quick look is not working either, beside movie memory issues.
到目前为止我的解决方法是使用presentOpenInMenuFromRect而不是presentOptionsMenuFromRect,这将显示更少的项目,但至少它不会导致内存问题。在iOS 8 beta 5下,QuickLook选项似乎也有问题,除了电影内存问题之外,pdf快速查看也不起作用。
#4
1
Simple solution: keep the UIDocumentInteractionController
as View Controller variable (property or instance var) and init it inside viewDidLoad
(in my case I initialized it without any parameters). If the fileURL you want to open is dynamically changes, simply change UIDocumentInteractionController.URL
property before presenting.
简单的解决方案:将UIDocumentInteractionController保持为View Controller变量(属性或实例var)并在viewDidLoad中初始化它(在我的情况下,我在没有任何参数的情况下初始化它)。如果要打开的fileURL是动态更改的,只需在呈现之前更改UIDocumentInteractionController.URL属性。
#5
0
I am running into this with UIActivityViewController
, when passing in a dictionary of NSData
items that represent PNG
images.
当我传入代表PNG图像的NSData项目字典时,我正在使用UIActivityViewController进行此操作。
I was able to speed up the rendering of the action sheet by converting the NSData
objects to UIImage
instances in the activityViewControllerPlaceholderItem:
method.
通过在ActiveViewControllerPlaceholderItem:方法中将NSData对象转换为UIImage实例,我能够加快动作表的呈现速度。
- (id)activityViewControllerPlaceholderItem:(UIActivityViewController *)activityViewController {
NSMutableDictionary *itemPlaceholders = [NSMutableDictionary dictionary];
[self.items enumerateKeysAndObjectsUsingBlock:^(NSString *key, NSData *obj, BOOL *stop) {
UIImage *placeholderImage = [UIImage imageWithData:obj scale:.5];
[itemPlaceholders setObject:placeholderImage forKey:key];
}];
return itemPlaceholders;
}