2016-04-01 16:14:34.258 EverPhoto[5567:1981394] plugin
com.tencent.xin.sharetimeline interrupted 2016-04-01 16:14:34.258
EverPhoto[5567:1981394] plugin com.tencent.xin.sharetimeline
invalIDated
这是代码:
__weak typeof(self) __weakSelf = self;self.activityVIEwController = [[UIActivityVIEwController alloc] initWithActivityItems:self.shareItems applicationActivitIEs:nil];self.activityVIEwController.excludedActivityTypes = @[UIActivityTypePostToFacebook,UIActivityTypePostToTwitter,UIActivityTypePostToVimeo,UIActivityTypePostToTencentWeibo,UIActivityTypePrint,UIActivityTypecopytopasteboard,UIActivityTypeAssignToContact,UIActivityTypeSavetoCameraRoll,UIActivityTypeAddToReadingList,UIActivityTypePostToFlickr,];self.activityVIEwController.completionWithItemsHandler = ^(Nsstring * __nullable activityType,BOol completed,NSArray * __nullable returnedItems,NSError * __nullable activityError){ DLog(@"shareCompleted : %@",completed ? @"YES" : @"NO") __weakSelf.shareItems = nil; __weakSelf.activityVIEwController = nil;};[self.containerVc presentVIEwController:self.activityVIEwController animated:YES completion:nil];
ShareItems是实现协议UIActivityItemSource的自定义对象.
附:我尝试了APP Google Photo,发现它在共享功能方面做得很好.它可以使用UIActivityVIEwController与WeChat共享9张图像,甚至是原始高清尺寸的系统照片断言.
那么,我该如何解决这个问题呢?
根据Apple的 App Extension Programming Guide:优化效率和性能
Memory limits for running app extensions are significantly lower than the memory limits imposed on a foreground app. On both platforms,the system may aggressively terminate extensions because users want to return to their main goal in the host app. Some extensions may have lower memory limits than others: For example,Widgets must be especially efficIEnt because users are likely to have several Widgets open at the same time.
1.我创建了9个非常小的图像,并与微信成功分享:
- (UIImage *)imageWithcolor:(UIcolor *)color{ CGRect rect = CGRectMake(0,1,1); UIGraphicsBeginImageContext(rect.size); CGContextRef context = UIGraphicsGetCurrentContext(); CGContextSetFillcolorWithcolor(context,[color CGcolor]); CGContextFillRect(context,rect); UIImage *image = UIGraphicsGetimageFromCurrentimageContext(); UIGraphicsEndImageContext(); return image;}
2.在与微信分享之前,您可以缩小图像,这里是Scale methods
总结以上是内存溢出为你收集整理的ios – UIActivityViewController将图像分享到微信无法正常工作全部内容,希望文章能够帮你解决ios – UIActivityViewController将图像分享到微信无法正常工作所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)