title: ARC and weak IBOutlet properties
body: <p>I just updated a project to make use of ARC with the Xcode 4.2 built-in conversion tool. Unfortunately there is a weird bug appearing that I don't understand and didn't find anything about. I have a document class with a property declaration:</p>
  
  <pre><code>@property (weak) IBOutlet WebView *webView;
  </code></pre>
  
  <p>In the implementation file I have a @synthesize statement:</p>
  
  <pre><code>@synthesize webView=_webView;
  </code></pre>
  
  <p>When I try to compile it, it fails and tells me:</p>
  
  <blockquote>
    <p>error: @synthesize of 'weak' property is only allowed in ARC or GC
    mode</p>
  </blockquote>
  
  <p>Of course the project is tagged to compile with ARC. I would highly appreciate any help to understand what I'm doing wrong and why.</p>
  
  <p>Edit: Was late yesterday. So here is a more complete compile-log:</p>
  
  <blockquote>
    <p>[...] -fobjc-arc -Wno-trigraphs -fpascal-strings -O0 -Wmissing-prototypes -Wreturn-type -Wparentheses -Wswitch -Wno-unused-parameter -Wunused-variable -Wunused-value -Wshorten-64-to-32 -DDEBUG=1 -isysroot /Developer/SDKs/MacOSX10.7.sdk -fasm-blocks -mmacosx-version-min=10.7 -gdwarf-2 -Wno-sign-conversion "-DIBOutlet=<strong>attribute</strong>((iboutlet))" "-DIBOutletCollection(ClassName)=<strong>attribute</strong>((iboutletcollection(ClassName)))" "-DIBAction=void)<strong>attribute</strong>((ibaction)" -iquote [...]/Build/Intermediates/[...].build/Debug/[...].build/[...]-generated-files.hmap -I[...]/Build/Intermediates/[...].build/Debug/[...].build/[...]-own-target-headers.hmap -I[...]/Build/Intermediates/[...].build/Debug/[...].build/[...]-all-target-headers.hmap -iquote [...]/Build/Intermediates/[...].build/Debug/[...].build/[...]-project-headers.hmap -I[...]/Build/Products/Debug/include -I[...]/Build/Intermediates/[...].build/Debug/[...].build/DerivedSources/x86_64 -I[...]/Build/Intermediates/[...].build/Debug/[...].build/DerivedSources -F[...]/Build/Products/Debug -fno-objc-arc [...]</p>
  </blockquote>
  
  <p>It seems the compiler-settings for ARC are turned on in the beginning and turned off again later in the arguments list. To be honest: I don't know where to remove such weird settings and how it came to this. The only solution I would come up with now, would be to start the complete project over from a blank and new one and import all the class files from scratch.</p>
  
  <p>If someone knows an easier way, I would appreciate very much.</p>
  
  <p>PS: I do have all build-settings concerning the ARC set to YES.</p>