Re: Connecting a button to MyView zeros integers
Re: Connecting a button to MyView zeros integers
- Subject: Re: Connecting a button to MyView zeros integers
- From: Roland King <email@hidden>
- Date: Fri, 13 Feb 2015 23:10:02 +0800
>>
>> Release the Control-drag. The assistant editor displays a Connection menu. In this menu, type the name of the action method (chooseWarrior in the screenshot below), and click Connect.
>>
>> [picture shows a menu with space to enter name of action]
>
> This is for adding a new outlet/action. I was under the impression you had an existing one that you just wanted to hook up?
I didn't read it that way. Further on down he says "Insertion of - (IBAction)act:(id)sender { } occurs only in my AppDelegate" which I took to mean the drag-to-insert-method-stub bit doesn't work. I suggested just adding the IBAction by hand in the .h file. I'm not sure I ever tried the auto-add method stuff so I have no idea if it works, but I do know typing the IBAction code in by hand does and takes about 2 seconds.
>>
>> This Xcode_Overview example uses an implementation file, not AppDelegate. It does not add an empty object in IB.
>>
>> Xcode is not allowing connection to my MyView file. Insertion of - (IBAction)act:(id)sender { } occurs only in my AppDelegate, which of course responds to the button. Clicking the button in the View initiates the IBAction, which indicates that I’m following the instruction correctly. I do the same steps when I try it with my MyView file, which fails.
>>
>> Might this be a bug? Or a defective copy of Xcode? Has anyone observed the same behavior?
>
> I'm not sure what you're trying to do. Can you give us a better description? Your app delegate has an act: method but you're trying to connect to it by dragging to a MyView?
The way I read it is he wants an act: method on his MyView and is trying to add the method by dragging to the interface/implementation file and is failing to get the code inserted into the file, but when he drags to the Delegate object then it works, and it also connects it. I also asked if the view he's dragging to has its class set correctly to MyView because if it's not, that would probably indicate both why the method isn't added by drag and why it can't be connected.
> _______________________________________________
>
> Cocoa-dev mailing list (email@hidden <mailto:email@hidden>)
>
> Please do not post admin requests or moderator comments to the list.
> Contact the moderators at cocoa-dev-admins(at)lists.apple.com <http://lists.apple.com/>
>
> Help/Unsubscribe/Update your Subscription:
>
> This email sent to email@hidden <mailto:email@hidden>
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden