Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
You can do it easier.
Go to your Proejct, go to your target, then "Build Phases" Tab, then to the Compile Sources ->
Find the code files of the library you are trying. and double click on it, you will be able to insert compiler flags.
Type in here
Code:
 -fno-objc-arc

If you add that, it won't try to do ARC compiling on these files :)
Or you can just convert the files to ARC with the build in ARC-Converter ;p
 
You can do it easier.
Go to your Proejct, go to your target, then "Build Phases" Tab, then to the Compile Sources ->
Find the code files of the library you are trying. and double click on it, you will be able to insert compiler flags.
Type in here
Code:
 -fno-objc-arc

If you add that, it won't try to do ARC compiling on these files :)
Or you can just convert the files to ARC with the build in ARC-Converter ;p
Thanks, I did it but I found the warning is due to static analyzer as below:
 

Attachments

  • Screen Shot 2012-06-04 at 23.08.31.jpg
    Screen Shot 2012-06-04 at 23.08.31.jpg
    207.8 KB · Views: 114
  • Screen Shot 2012-06-04 at 23.08.42.jpg
    Screen Shot 2012-06-04 at 23.08.42.jpg
    219.6 KB · Views: 104
  • Screen Shot 2012-06-04 at 23.08.52.jpg
    Screen Shot 2012-06-04 at 23.08.52.jpg
    222.2 KB · Views: 89
The problem with directions looks strange at first because I don't have all of the code, but the second problem is related to ARC and he needs to use one of those bridging casts for objects created with CoreFoundation. Maybe __bridge_retained in this case, but I still don't use ARC so I'm not sure.
 
The analyzer is complaining that the method returns an owned object rather than an autoreleased object but the name of the method doesn't indicate that it's returning an owned object. This isn't related to ARC.

Is the returned path CFReleased somewhere else in the code? If so you could fix this by changing the name to start with new.

UIBezierPath is similar to CGPath and the code could probably be rewritten to use UIBezierPath without much difficulty. If so it would then use Cocoa memory management and not CF memory management. I don't think CGPath is toll-free-bridged with an Objective-C class so there isn't a one-line change for this.
 
The analyzer is complaining that the method returns an owned object rather than an autoreleased object but the name of the method doesn't indicate that it's returning an owned object. This isn't related to ARC.

Is the returned path CFReleased somewhere else in the code? If so you could fix this by changing the name to start with new.

Strange, I was sure ARC would let you use CF objects, you only need to use one of those casts, like __bridge_retained or __bridge_transfer. Here the path is created with the call to CGPathCreateMutable() and since he can't change the name of that function what else could he do?
 
Well, seems like I misinterpreted intentions of the method on those three images. It was actually expected to return a new retained object and not autoreleased one. Since the word 'create' is not one of those magic keywords (new, alloc, copy and mutableCopy) he really needs to change the method name so it starts with 'new'.

Must admit I have several methods that do exactly the same thing: They start with the word create and return - what else but CGPathRef. Now I see why were you talking about toll-free bridging. In order to autorelease it I would need an equivalent cocoa object. Ah. Now I need to change those method names in my own code.

And now I see where I picked the habit of using such naming convention: Programming with Quartz. They do it all the time. All the functions that create new CoreGraphics objects start that way. As I was converting them into Obj-C methods I kept the similar name and now I have the problem.
 
Last edited:
As an Amazon Associate, MacRumors earns a commission from qualifying purchases made through links in this post.
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.