我有一些代码包装从ALAssetLibrary中枚举资产中检索的ALAsset对象.我收到用户遇到崩溃的报告,该部分包装对象要求其包含的元数据的ALAsset.
崩溃的代码是在这个包装类中,它只是要求它的ALAsset的元数据,如下所示:
[[myAlAsset defaultRepresentation] Metadata];
这是一个部分堆栈跟踪,代表我看到的崩溃:
0 CoreFoundation CFDataGetBytePtr + 5 1 PhotoLibraryServices __46-[PLManagedAsset adjustmentsXMPRepresentation]_block_invoke + 228 2 PhotoLibraryServices __46-[PLManagedAsset adjustmentsXMPRepresentation]_block_invoke + 228 3 CoreData developerSubmittedBlockToNSManagedObjectContextPerform + 88 4 CoreData -[NSManagedObjectContext performBlockAndWait:] + 114 5 PhotoLibraryServices -[PLManagedAsset adjustmentsXMPRepresentation] + 226 6 AssetsLibrary __33-[ALAssetRepresentation Metadata]_block_invoke + 24 7 AssetsLibrary __53-[ALAssetRepresentationPrivate _performBlockAndWait:]_block_invoke + 68 8 CoreData developerSubmittedBlockToNSManagedObjectContextPerform + 88 9 libdispatch.dylib _dispatch_client_callout + 22 10 libdispatch.dylib _dispatch_barrier_sync_f_invoke + 26 11 CoreData -[NSManagedObjectContext performBlockAndWait:] + 106 12 AssetsLibrary -[ALAssetsLibrary _performBlockAndWait:] + 134 13 AssetsLibrary -[ALAssetRepresentationPrivate _performBlockAndWait:] + 176 14 AssetsLibrary -[ALAssetRepresentation Metadata] + 464
有人有什么想法可能会发生什么?以这些资产为基础的AlAssetLibrary保存为静态引用,因此不应该在内存中进行清理,因此我不会指望ALAsset已被无效.这个问题似乎已经开始专门针对iOS 7发布了.
崩溃本身是EXC_BAD_ACCESS,KERN_INVALID_ADDRESS为0x0.