0

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?

Mark
  • 11
  • 1
  • your code is correct. I think you have written it outside any function. – Saurabh Passolia Feb 27 '14 at 13:07
  • you have an example how such a function would look like? and why can I use that only inside a function? – Mark Feb 27 '14 at 13:22
  • 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) – Saurabh Passolia Feb 27 '14 at 13:33

1 Answers1

0

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)

Saurabh Passolia
  • 8,099
  • 1
  • 26
  • 41