dear风会停息 2015-12-11 01:51 采纳率: 13.8%
浏览 1636

IOS获取系统相册图片名称在非ARC模式下报错

dispatch_async(dispatch_get_main_queue(), ^{

    ALAssetsLibraryAssetForURLResultBlock resultblock = ^(ALAsset *myasset){

        ALAssetRepresentation *representation = [myasset defaultRepresentation];

        NSString *fileName = [representation filename];

        NSLog(@"fileName : %@",[representation filename]);
    };

    NSURL *imageURL = [info valueForKey:UIImagePickerControllerReferenceURL];

    ALAssetsLibrary* assetslibrary = [[ALAssetsLibrary alloc] init];
    [assetslibrary assetForURL:imageURL
                   resultBlock:resultblock
                  failureBlock:nil];

});

    报错信息:
    -[__NSArrayI scheme]: unrecognized selector sent to instance 0x7ff84d58a1f0

2015-12-11 09:49:45.126 MobileOA[1126:25670] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[__NSArrayI scheme]: unrecognized selector sent to instance 0x7ff84d58a1f0'
*** First throw call stack:
(
0 CoreFoundation 0x00000001092cff65 exceptionPreprocess + 165
1 libobjc.A.dylib 0x0000000108c94deb objc_exception_throw + 48
2 CoreFoundation 0x00000001092d858d -[NSObject(NSObject) doesNotRecognizeSelector:] + 205
3 CoreFoundation 0x0000000109225f7a ___forwarding
_ + 970
4 CoreFoundation 0x0000000109225b28 CF_forwarding_prep_0 + 120
5 PhotoLibraryServices 0x000000010cb2b65b +[PLManagedAsset photoFromAssetURL:photoLibrary:sidecar:] + 83
6 AssetsLibrary 0x0000000106cf89bf __56-[ALAssetsLibrary assetForURL:resultBlock:failureBlock:]_block_invoke324 + 36
7 CoreData 0x0000000111af0f17 developerSubmittedBlockToNSManagedObjectContextPerform + 199
8 libdispatch.dylib 0x0000000109a6049b _dispatch_client_callout + 8
9 libdispatch.dylib 0x0000000109a45051 _dispatch_barrier_sync_f_invoke + 393
10 CoreData 0x0000000111af0dfc -[NSManagedObjectContext performBlockAndWait:] + 252
11 AssetsLibrary 0x0000000106cf5dcc -[ALAssetsLibrary _performBlockAndWait:] + 134
12 AssetsLibrary 0x0000000106cf888c __56-[ALAssetsLibrary assetForURL:resultBlock:failureBlock:]_block_invoke_2 + 191
13 libdispatch.dylib 0x0000000109a3fef9 _dispatch_call_block_and_release + 12
14 libdispatch.dylib 0x0000000109a6049b _dispatch_client_callout + 8
15 libdispatch.dylib 0x0000000109a4834b _dispatch_main_queue_callback_4CF + 1738
16 CoreFoundation 0x00000001092303e9 __CFRUNLOOP_IS_SERVICING_THE_MAIN_DISPATCH_QUEUE
_ + 9
17 CoreFoundation 0x00000001091f1939 __CFRunLoopRun + 2073
18 CoreFoundation 0x00000001091f0e98 CFRunLoopRunSpecific + 488
19 GraphicsServices 0x000000010a7adad2 GSEventRunModal + 161
20 UIKit 0x000000010718a676 UIApplicationMain + 171
21 MobileOA 0x0000000105b6ee81 main + 97
22 libdyld.dylib 0x0000000109a9492d start + 1
)
libc++abi.dylib: terminating with uncaught exception of type NSException

求大神帮忙看看,求解决啊

  • 写回答

2条回答 默认 最新

  • qq_28185805 2015-12-11 02:37
    关注

    'dispatch_get_main_queue': identifier not found (犯错率:0% 犯错数:0 人)
    在语言符号 ) 前漏写语言符号 { (犯错率:11.3% 犯错数:91 人)
    建议:可能缺少“{”、“)”或“;”等语言符号
    ‘)’语法错误 (犯错率:8.6% 犯错数:69 人)
    建议:引起错误的原因很多,可能多加或少加了符号.*
    在语言符号 ; 前漏写语言符号 { (犯错率:11.3% 犯错数:91 人)
    建议:可能缺少“{”、“)”或“;”等语言符号
    '{' : missing function header (old-style formal list?) (犯错率:0% 犯错数:0 人)
    unknown character '0x40' (犯错率:0% 犯错数:0 人)
    ‘)’语法错误 (犯错率:8.6% 犯错数:69 人)
    建议:引起错误的原因很多,可能多加或少加了符号.*

    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?