The problem is a bit strange. Let me describe it in detail. I created a c header file FALog. hL as my log tool class (non-arc) instead of NSLog. This c file contains part of the objc code. My entire project is non-arc and only two files A and B are arc. In build parses, I set compile flags of A and B to-fobjc-arc, before I add files A and B, my FALog can be compiled normally. After adding files A and B, in FALog, my release and autorelease always prompt "release is not allowed under arc", as shown below: [cpp] 'autorelease 'is unavailable: not available in automatic reference counting mode the problem is that my FALog is really not an arc, and it's crazy. The final solution is fruitless. I decided to check if my falog is true of arc and use the macro: [cpp] # if _ has_feature (objc_arc) // ARC is On # else // ARC is Off # endif it turns out that my falog is non-arc and speechless, So I add macro judgment before and after my release code, [html] # if! (_ Has_feature (objc_arc) NSDateFormatter * dateFormatter = [[[NSDateFormatter alloc] init] autorelter]; # endif is compiled successfully. I am speechless and it is not arc, now, let me determine if arc can be compiled successfully. I don't know what's going on with xcode. It has been bothering me for n days. I hope it will help you. In addition, if the arc and non-arc files are mixed in ios, you can specify compile flags in build parses. If the arc file is set to "-fobjc-arc ", non-arc file is set to "-fno-objc-arc"