How to know whether a project uses ARC

There are 2 method to check whether a project is using ARC.
1. Select the project, open Build Settings. Look for Objective-C Automatic Reference Counting in the Apple LLVM Compile - Language section.

2. Try sth like this in code:
     [[[NSObject alloc] init] ]autorelease];

   If U get an error :ARC forbids explicit message send of 'autorelease'
   then, U R using ARC.
   

猜你喜欢

转载自lisai.iteye.com/blog/1990751