I have added ALAssetsLibrary framework to my project and for some reason XCode doesnt detect it.
I have no code completion, and XCode gives a warning and then crashes when I use the following code
ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init];
[library enumerateGroupWithTypes:ALAssetsGroupAlbum
usingBlock:assetGroupEnumerator
failureBlock:^(NSError *error){
NSLog(@"A problem occured");
}];
It doesnt detect what ALAssetsLibrary is and the warning which leads to a crash is
warning: 'ALAssetsLibrary' may not respond to '-enumerateGroupWithTypes:usingBlock:failureBlock:'
Why isnt XCode detecting the framework?
I have added it to my project as well as imported it.
I would really app开发者_运维知识库reciate the help with this, I dont understand what I did wrong. Thanks
Choose "Device", not "Simulator".
First, you're importing AssetsLibrary.h, are you sure this refers to the class ALAssetsLibrary and ALAssetsGroupAlbum?
Second, I'm not sure it failing to find it is the problem, I imagine there would be a different error in that case, such as, this class is not defined, first use in function.
It's saying unrecognized selector, which means there might be a problem with your pointers.
Have you got your SDK set to 3.x? Blocks were only introduced in iOS 4.0, along with all the methods relating to them.
精彩评论