Re: ARC code in a non ARC app. iOS

2016-02-25 Thread Uli Kusterer
On 24 Feb 2016, at 00:25, Alex Zavatone wrote: > Would it be recommended to package my ARC code with ARC turned off and > package that in a framework and then link to that from the non ARC app that > will need to load it? Nope, that would leak all over the place, or dangle pointers depending o

Re: ARC code in a non ARC app. iOS

2016-02-25 Thread Quincey Morris
On Feb 25, 2016, at 22:15 , Uli Kusterer wrote: > > Did you really mean +newBlah ? Not something like +blahWithX: or just +blah? > Because +new is documented to just be a shorthand for +alloc followed by > -init on the result, so +newBlah behaving differently than +new sounds kinda > inconsist

Re: ARC code in a non ARC app. iOS

2016-02-25 Thread Uli Kusterer
On 24 Feb 2016, at 00:47, Quincey Morris wrote: > For example, an object obtained via [[…alloc]init…] is generally assumed to > be returned with a +1 ownership, but an object obtained via a class method > named ‘newXXX…’ is generally assumed to be returned with +0 ownership. Did you really me

Re: ARC code in a non ARC app. iOS

2016-02-25 Thread Dave
> On 25 Feb 2016, at 17:43, Jens Alfke wrote: > > >> On Feb 25, 2016, at 8:35 AM, Dave > > wrote: >> Also, beware subclassing a Non-ARC Class in an ARC Project - you have to have the subclass Non-ARC too. >>> >>> This is not true. For example, NSView

Re: ARC code in a non ARC app. iOS

2016-02-25 Thread Jens Alfke
> On Feb 25, 2016, at 8:35 AM, Dave wrote: > >>> Also, beware subclassing a Non-ARC Class in an ARC Project - you have to >>> have the subclass Non-ARC too. >> >> This is not true. For example, NSView is not ARC but you can write ARC >> subclasses of it. > > I didn’t say it was impossible, b

Re: ARC code in a non ARC app. iOS

2016-02-25 Thread Dave
> On 24 Feb 2016, at 23:57, Greg Parker wrote: > > >> On Feb 24, 2016, at 2:31 AM, Dave wrote: >> >> Also, beware subclassing a Non-ARC Class in an ARC Project - you have to >> have the subclass Non-ARC too. > > This is not true. For example, NSView is not ARC but you can write ARC > subcla

Re: ARC code in a non ARC app. iOS

2016-02-24 Thread Britt Durbrow
Tangentially related: I have a bug ( rdar://10894595 ) open on the Developer Tools (Xcode/clang) to add a #pragma to turn on/off ARC in the source code, for dealing with just such situations. I dunno’ how much work it would be to implement… I imagine not all that much for somebody familiar wi

Re: ARC code in a non ARC app. iOS

2016-02-24 Thread Greg Parker
> On Feb 24, 2016, at 2:31 AM, Dave wrote: > > Also, beware subclassing a Non-ARC Class in an ARC Project - you have to have > the subclass Non-ARC too. This is not true. For example, NSView is not ARC but you can write ARC subclasses of it. -- Greg Parker gpar...@apple.com Runtime

Re: ARC code in a non ARC app. iOS

2016-02-24 Thread Dave
Also, beware subclassing a Non-ARC Class in an ARC Project - you have to have the subclass Non-ARC too. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator comments to the list. Contact the moderator

Re: ARC code in a non ARC app. iOS

2016-02-23 Thread Alex Zavatone
Ok time for me to establish base test cases in very simple cases first. Sent from my iPhone > On Feb 23, 2016, at 6:47 PM, Quincey Morris > wrote: > >> On Feb 23, 2016, at 15:25 , Alex Zavatone wrote: >> >> Would it be recommended to package my ARC code with ARC turned off and >> package th

Re: ARC code in a non ARC app. iOS

2016-02-23 Thread Greg Parker
> On Feb 23, 2016, at 3:46 PM, Alex Zavatone wrote: > > Aha! > > Awesome. That will work nicely. > > Now my concern is the compiled c lib that my code links to. Do I also have > to rebuild that with non ARC flags too? The ARC flags only affect the Objective-C and Objective-C++ compilers. P

Re: ARC code in a non ARC app. iOS

2016-02-23 Thread Quincey Morris
On Feb 23, 2016, at 15:25 , Alex Zavatone wrote: > > Would it be recommended to package my ARC code with ARC turned off and > package that in a framework and then link to that from the non ARC app that > will need to load it? This would be a really bad idea. :) Your code has no retains and rel

Re: ARC code in a non ARC app. iOS

2016-02-23 Thread Alex Zavatone
Aha! Awesome. That will work nicely. Now my concern is the compiled c lib that my code links to. Do I also have to rebuild that with non ARC flags too? Sent from my iPhone > On Feb 23, 2016, at 6:33 PM, Greg Parker wrote: > > >> On Feb 23, 2016, at 3:25 PM, Alex Zavatone wrote: >> >> Wo

Re: ARC code in a non ARC app. iOS

2016-02-23 Thread Greg Parker
> On Feb 23, 2016, at 3:25 PM, Alex Zavatone wrote: > > Would it be recommended to package my ARC code with ARC turned off and > package that in a framework and then link to that from the non ARC app that > will need to load it? Building a separate dylib or static archive is not necessary, bu

Re: ARC code in a non ARC app. iOS

2016-02-23 Thread Alex Zavatone
Ok. Great. I knew there would be some scariness in there I'd need to know about. Are there any tools in Instruments or approaches to make sure I'm not going to destroy the universe when calling my stuff? I'm planning on starting by loading a placeholder one screen storyboard as an initial test

Re: ARC code in a non ARC app. iOS

2016-02-23 Thread Alex Zavatone
Yeah, it does. I was thinking about it bassackwardsly. Would it be recommended to package my ARC code with ARC turned off and package that in a framework and then link to that from the non ARC app that will need to load it? Thank you, sir. AZ Sent from my iPhone > On Feb 23, 2016, at 6:16

Re: ARC code in a non ARC app. iOS

2016-02-23 Thread Quincey Morris
On Feb 23, 2016, at 13:30 , Alex Zavatone wrote: > > Now, I'm familiar with the -fno-objc-arc build flags to disable compiling one > file at a time, but is there any possibility to include iOS code that does > use ARC within an app that doesn't? You can mix-and-match ARC source with non-ARC (M

Re: ARC code in a non ARC app. iOS

2016-02-23 Thread Greg Parker
> On Feb 23, 2016, at 1:30 PM, Alex Zavatone wrote: > > Hi all. I'm in the middle of looking at an interesting problem on the iOS > side. > > We have our code that is ARC and uses external compiled C libs that I'm being > asked to plug into another iOS project that's significantly larger tha