UIWebView 网页图片上传报错

来源:互联网 发布:c 软件 编辑:程序博客网 时间:2024/04/29 22:04

错误信息为:

2016-03-24 10:57:38.206 ----------[19720:1554725] Passed in type public.item doesn't conform to either public.content or public.data. If you are exporting a new type, please ensure that it conforms to an appropriate parent type.

2016-03-24 10:57:38.409 ----------[19720:1554725] the behavior of the UICollectionViewFlowLayout is not defined because:

2016-03-24 10:57:38.409 ----------[19720:1554725] the item width must be less than the width of the UICollectionView minus the section insets left and right values, minus the content insets left and right values.

2016-03-24 10:57:38.411 ----------[19720:1554725] The relevant UICollectionViewFlowLayout instance is <_UIAlertControllerCollectionViewFlowLayout: 0x140cb6e70>, and it is attached to <UICollectionView: 0x14000da00; frame = (0 44; 10 0); clipsToBounds = YES; gestureRecognizers = <NSArray: 0x140be5990>; animations = { bounds.origin=<CASpringAnimation: 0x140cb5b20>; bounds.size=<CASpringAnimation: 0x140cc3900>; position=<CASpringAnimation: 0x14083de00>; }; layer = <CALayer: 0x140cb73a0>; contentOffset: {0, 0}; contentSize: {0, 0}> collection view layout: <_UIAlertControllerCollectionViewFlowLayout: 0x140cb6e70>.

2016-03-24 10:57:38.411 ----------[19720:1554725] Make a symbolic breakpoint at UICollectionViewFlowLayoutBreakForInvalidSizes to catch this in the debugger.

2016-03-24 10:57:41.846 ----------[19720:1554725] Warning: Attempt to present <UIImagePickerController: 0x13fabb800> on <UITabBarController: 0x140abfba0> whose view is not in the window hierarchy!


从网上找的资料:

1.  http://stackoverflow.com/questions/26376940/upload-photo-with-uiwebview

2.  http://stackoverflow.com/questions/25942676/ios-8-sdk-modal-uiwebview-and-camera-image-picker


测试的webview加上这段代码可以。但是我这个不行。

-(void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion{    if ( self.presentedViewController)    {        [super dismissViewControllerAnimated:flag completion:completion];    }}

因为我一开始做了一个UINavigationController控制页面,然后直接presentViewController一个tabBarController在上面 

加这段代码不行。
把presentViewController改成navigationController pushViewController就可以了。


0 0
原创粉丝点击