Re: iOS 9: Adding CALayer to self.view.layer causes EXC_BAD_ACCESS

2016-12-06 Thread じょいすじょん
> On 2016 Dec 7, at 6:27, Carl Hoefs wrote: > >> >> On Dec 6, 2016, at 1:33 PM, Carl Hoefs >> wrote: >> >>> On Dec 6, 2016, at 1:24 PM, David Duncan wrote: >>> >>> Your safest bets are to either clear

Re: iOS 9: Adding CALayer to self.view.layer causes EXC_BAD_ACCESS

2016-12-06 Thread Carl Hoefs
> On Dec 6, 2016, at 1:33 PM, Carl Hoefs wrote: > >> On Dec 6, 2016, at 1:24 PM, David Duncan wrote: >> >> Your safest bets are to either clear the delegate of the layer at an >> appropriate time (possibly in your view controller’s

Re: iOS 9: Adding CALayer to self.view.layer causes EXC_BAD_ACCESS

2016-12-06 Thread Carl Hoefs
> On Dec 6, 2016, at 1:24 PM, David Duncan wrote: > > Your safest bets are to either clear the delegate of the layer at an > appropriate time (possibly in your view controller’s dealloc is all that is > necessary), or to use a UIView instead of a raw CALayer in this

Re: iOS 9: Adding CALayer to self.view.layer causes EXC_BAD_ACCESS

2016-12-06 Thread David Duncan
> On Dec 6, 2016, at 11:51 AM, Doug Hill wrote: > > I've wondered about this before, but maybe some Objective-C runtime experts > know. > > Does writing directly to the ivar backing a property bypass the ARC features > of the property. For example, will a strong property

Re: iOS 9: Adding CALayer to self.view.layer causes EXC_BAD_ACCESS

2016-12-06 Thread David Duncan
> On Dec 6, 2016, at 11:44 AM, Carl Hoefs > wrote: > > I get the following crash in my iOS 9 app simply by adding a CALayer to the > current view controller's self.view.layer and then dismissing the current > view controller. Simplified code: > >@property

Re: iOS 9: Adding CALayer to self.view.layer causes EXC_BAD_ACCESS

2016-12-06 Thread Carl Hoefs
FWIW, it still crashes if I change the code to use self.layer instead of _layer: @property (strong,nonatomic) CALayer *layer; . . . self.layer = [[CALayer alloc] init]; [self.layer setDelegate: self]; [self.view.layer addSublayer:self.layer]; -Carl > On Dec 6, 2016, at 12:51

Re: iOS 9: Adding CALayer to self.view.layer causes EXC_BAD_ACCESS

2016-12-06 Thread Doug Hill
I've wondered about this before, but maybe some Objective-C runtime experts know. Does writing directly to the ivar backing a property bypass the ARC features of the property. For example, will a strong property be retained if you write directly to the ivar? If not, that's your problem. Doug

iOS 9: Adding CALayer to self.view.layer causes EXC_BAD_ACCESS

2016-12-06 Thread Carl Hoefs
I get the following crash in my iOS 9 app simply by adding a CALayer to the current view controller's self.view.layer and then dismissing the current view controller. Simplified code: @property (strong,nonatomic) CALayer *layer; . . . _layer = [[CALayer alloc] init]; [_layer