Skip to content

Instantly share code, notes, and snippets.

@TonnyXu
Created February 17, 2012 09:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TonnyXu/1852165 to your computer and use it in GitHub Desktop.
Save TonnyXu/1852165 to your computer and use it in GitHub Desktop.
The difference between Strong and Retain

A wired compiler error

Have you ever seen a compiler error like:

error: expected a property attribute before 'strong'

I met one today. The same code was compiled and worked fine in my iPhone project but another similar iPad version could not pass the compilation. WTF? After googling it. I found the reason.

Solution

To eliminate this error, you need to set the compiler to Apple LLVM Compiler 3.x in your project and target's configuration. Refer the SO question. The strong keyword is newly introduced by ARC, and currently only Clang(LLVM) support this.

What's to say.

It's time to move to ARC and LLVM! Start learning LLVM and ARC NOW.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment