ARC and IOS5

200 views
Skip to first unread message

Dan Lange

unread,
Jul 5, 2011, 2:38:57 PM7/5/11
to coreplot-discuss
Is anyone working on version that will compile with ARC?

sas

unread,
Jul 8, 2011, 6:51:52 AM7/8/11
to coreplot-discuss
I'm not sure to what extent it's appropriate to discuss this here
considering NDAs. So I hope the admins are ok with the following
comment:

Including CorePlot-CocoaTouch as a non-ARC subproject in an ARC
project works for me when I make the following handful of changes to
the headers (there are about 7 or 8 of these):

-@property (nonatomic, readwrite, assign) __weak
CPTAnnotationHostLayer *annotationHostLayer;
+@property (nonatomic, readwrite, weak) CPTAnnotationHostLayer
*annotationHostLayer;

That fixes the following error:

CPTAnnotation.h:17:1: error: property attributes 'assign' and 'weak'
are mutually exclusive [3]
@property (nonatomic, readwrite, assign) __weak
CPTAnnotationHostLayer *annotationHostLayer;
^

After that it works.

Now I have to admit I'm not entirely sure if I'm doing the right thing
here. I think it does but I want to check the docs at some point (note
to self: really, do it!). My app builds and runs with this change but
I haven't done any Leaks checking.

I also tried converting all of CorePlot to ARC but it threw up some
issues with setImage: (setters of CGImageRef things) that I wasn't
sure how to resolve straight away.

-sas

Drew McCormack

unread,
Jul 9, 2011, 6:01:41 AM7/9/11
to coreplot...@googlegroups.com
I made the same changes as you a while ago, and it works for ARC, but the problem is that it then doesn't work for GC and manual memory management. I'm hoping it is just a question of the compilers being fixed to handle the weak property attribute. We will hold off on a change until we know how to handle it.

Drew

> --
> You received this message because you are subscribed to the Google Groups "coreplot-discuss" group.
> To post to this group, send email to coreplot...@googlegroups.com.
> To unsubscribe from this group, send email to coreplot-discu...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/coreplot-discuss?hl=en.
>

Reply all
Reply to author
Forward
0 new messages