Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Parse Issue: Module 'not found'

In Xcode, I keep getting a strange error. I am using this github library: https://github.com/tapsquare/TSLibraryImport

And I am using the example code in my mediaPicker delegate method like so:

- (void)mediaPicker: (MPMediaPickerController *)mediaPicker didPickMediaItems:(MPMediaItemCollection *)mediaItemCollection {
    for (MPMediaItem *item in mediaItemCollection.items) {
        NSURL* assetURL = [item valueForProperty:MPMediaItemPropertyAssetURL];
        NSURL* destinationURL = nil; //file URL for the location you'd like to import the asset to.
        TSLibraryImport *import = [[TSLibraryImport alloc] init];
        [import importAsset:assetURL toURL:destinationURL completionBlock:^(TSLibraryImport *theImport) {

        }];
    }
    [mediaPicker dismissViewControllerAnimated:YES completion:nil];
}

On the importAsset line, I keep getting the error: Parse Issue: Module 'importAsset' not found.

Now I have dragged in TSLibraryImport.h/.m in and made sure the .m was in the compile sources but still it shows the error.

Does anyone know why this is happening? It doesn't seem to happen in the library's sample project.

like image 510
SimplyKiwi Avatar asked Jul 25 '26 11:07

SimplyKiwi


1 Answers

I found this question after encountering the same problem. For anyone else who runs into this issue, it turns out that recent versions of XCode (I'm using XCode 5) use import as a global variable for automatic memory management. You can fix it by renaming the TSLibraryImport pointer something else.

TSLibraryImport *tsImport = [[TSLibraryImport alloc] init];
like image 196
CaptainStiggz Avatar answered Jul 28 '26 02:07

CaptainStiggz



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!