ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; - ERROR

244 Views Asked by At

If I try to run this, I get the error:

"Initializer element is not a compile-time constant."

Can anybody explain to a newly like me why this is happening?

1

There are 1 best solutions below

0
On

your code is correct. I think you have written it outside any function.

what I meant is the line of code ALAssetsLibrary *library = [[ALAssetsLibrary alloc] init]; must be in any method and NOT global(outside function so that the library variable becomes global)