Re: Is it possible for a subclass to set the ivar of its base class?

2016-10-16 Thread OC
Patrick, On 24. 9. 2016, at 17:11, Patrick J. Collins wrote: > I am trying to change the behavior of a library by subclassing one of the > files, but am finding this is not working because I can't access (change) one > of the internal instance variables. ... Is there a way I can get access to

Re: Is it possible for a subclass to set the ivar of its base class?

2016-10-15 Thread Manoah F. Adams
On Sep 24, 2016, at 08:11:00, Patrick J. Collins wrote: I am trying to change the behavior of a library by subclassing one of the files, but am finding this is not working because I can't access (change) one of the internal instance variables. To illustrate my problem: Rofl *rofl = [[Rof

Re: Is it possible for a subclass to set the ivar of its base class?

2016-09-24 Thread Patrick J. Collins
> You can’t add a method (setOtherWut) to the base class in the subproject? > That would be easier than mucking with the run-time. Yeah I can.. I just was trying to avoid modifying someone else's code... If that's the way to do it then I guess that's what I will have to do. That just seems highl

Re: Is it possible for a subclass to set the ivar of its base class?

2016-09-24 Thread Quincey Morris
On Sep 24, 2016, at 12:15 , Patrick J. Collins wrote: > > There's no way to do this without duplicating tons of their code? You can’t add a method (setOtherWut) to the base class in the subproject? That would be easier than mucking with the run-time. ___

Re: Is it possible for a subclass to set the ivar of its base class?

2016-09-24 Thread Patrick J. Collins
> could just subclass as make my own custom setter. So I can call both Oops sorry-- subclass *AND* make my own custom setter. Patrick J. Collins http://collinatorstudios.com ___ Do not post admin requests to the list. They will be ignored. Objc-languag

Re: Is it possible for a subclass to set the ivar of its base class?

2016-09-24 Thread Patrick J. Collins
> How do you know this *is* the implementation in the base class? How do you > know there *is* a private variable called “_wut”, or its type, or what value > it actually contains, or if there are any other > variables that must be set consistently whenever the value of the “wut” > property chang

Re: Is it possible for a subclass to set the ivar of its base class?

2016-09-24 Thread Quincey Morris
On Sep 24, 2016, at 08:11 , Patrick J. Collins wrote: > >@implementation Lol { >int _wut; >} > >-(void)setWut:(int)wut { >_wut = wut; >// side effects I do not want. >} How do you know this *is* the implementation in the base class? How do you know ther

Re: Is it possible for a subclass to set the ivar of its base class?

2016-09-24 Thread Jens Alfke
> On Sep 24, 2016, at 8:11 AM, Patrick J. Collins > wrote: > > When I run this, I get 0 instead of 123. Right; you’ve created a new, different ivar in the subclass, which just happens to have the same name. > Is there a way I can get access to the _wut ivar in the base class Yes, by using