Re: #selector noob question

2016-03-22 Thread Quincey Morris
On Mar 22, 2016, at 07:21 , Eric E. Dolecki wrote: > > myButton.addTarget(self, action: #selector(AudioElement.selected(_:)), > forControlEvents: .TouchUpInside) > I get it now that I can see what's going on with better context. I can also > just replace AudioElement with self. It’s slightly b

Re: #selector noob question

2016-03-22 Thread Eric E. Dolecki
Okay - Xcode just finished installing and I got to see my code in situ with fixable warnings. myButton.addTarget(self, action: "selected:", forControlEvents: .TouchUpInside) //above shows fixable warning. Changes to this: myButton.addTarget(self, action: #selector(AudioElement.selected(_:)), for

Re: #selector noob question

2016-03-22 Thread Eric E. Dolecki
Thanks for the answer. I am going to read it a few times. Back to the original question - if an object has an addTarget, will calling the non-string method name supply the object itself to the method? On Tue, Mar 22, 2016 at 9:28 AM Luther Baker wrote: > Thanks for posting this extended answer!

Re: #selector noob question

2016-03-22 Thread Luther Baker
Thanks for posting this extended answer! On Mon, Mar 21, 2016 at 11:34 PM Quincey Morris < quinceymor...@rivergatesoftware.com> wrote: > On Mar 21, 2016, at 20:27 , Eric E. Dolecki wrote: > > > > Quick question. If I use #selector(funcName) - does it always send an > > argument of the obj if the

Re: #selector noob question

2016-03-21 Thread Quincey Morris
On Mar 21, 2016, at 20:27 , Eric E. Dolecki wrote: > > Quick question. If I use #selector(funcName) - does it always send an > argument of the obj if the func requests it or not? > > If the function being called has a typed argument of something like > sender:UIButton, I can reference the sender