JJSaccolo / UIActivityIndicator-for-SDWebImage

The easiest way to add a UIActivityView to your SDWebImage view
MIT License
817 stars 160 forks source link

The error in UIImageView+UIActivityIndicatorForSDWebImage.m #17

Closed attolee closed 10 years ago

attolee commented 10 years ago

screen shot 2014-10-17 at 11 25 23 am I copy the files into project, using Xcode 6.

mythodeia commented 10 years ago

@AttoLee I just added them in my project where i use SDWebImage and i got no errors. I believe this is the answer to your question: http://stackoverflow.com/questions/16999749/expected-at-the-end-of-declaration-list

i tried to change the C Language Dialect to C99 and i got the same error as you, so make sure its default value is Compiler Default.

attolee commented 10 years ago

@mythodeia the error disappeared when i had changed the C Language Dialect to Compiler Default, thanks for your help. i just wander is that possible to use GNU99 to compile one file, and meanwhile use default compiler to compile another file, the two file in the same project.

mythodeia commented 10 years ago

@AttoLee of the top of my head could you try the following: Go in Build Phases tab on the Compile Sources and double tap on your file. Then add the flag you want. Maybe like this: -std=gnu99 I am not sure about the syntax or the validity of this but i cannot think of anywhere else you might be able to add this kind of feature. Its like adding the -fno-objc-arc per file. So i guess it might work! Why if i may ask you want this flag enabled for 1 file?

attolee commented 10 years ago

@mythodeia the project that i am working on is generated by Unity, of which C Language Dialect is C99.

screen shot 2014-10-22 at 2 17 22 pm

mythodeia commented 10 years ago

@AttoLee did you add the compiler flag -std=gnu99 in the specific file you want? Did it work?

attolee commented 10 years ago

@mythodeia i added the flag -std=gnu99 to UIImageView+UIActivityIndicatorForSDWebImage.m, more errors came.

screen shot 2014-10-22 at 2 39 05 pm

mythodeia commented 10 years ago

@AttoLee have you added all the necessary frameworks for SDWebImage to work properly?

attolee commented 10 years ago

@mythodeia thank you, i missed ImageIO.framework. and i added -ObjC to Other Linker Flags. but screen shot 2014-10-22 at 3 23 56 pm

mythodeia commented 10 years ago

@AttoLee i think the MapKit framework is missing..check it out

attolee commented 10 years ago

@mythodeia thank you again. i have added MapKit framework, all right now..

mythodeia commented 10 years ago

@AttoLee good luck with your project