Re: Hot to define a connection from source code?
Re: Hot to define a connection from source code?
- Subject: Re: Hot to define a connection from source code?
- From: Roland King <email@hidden>
- Date: Fri, 29 Jan 2010 13:04:05 +0800
Jonathan Chacón wrote:
Hello everybody,
OK, thanks for the information...
I'll find info about @selector, setActions in Objetive-C and I'll post this question in xCode list.
I want to develop some games for blind users in iPhone
thanks and regards
Jonathan Chacón
El 28/01/2010, a las 22:08, Jens Alfke escribió:
Jonathan, you don't have to use Interface Builder to create the user
interface piece at all if you don't want to. You can just create,
position and link the objects up yourself in code. That's actually how
the original iPhone development was done, before they had IB for iPhone.
Outlets are very simple, all an outlet is is an instance variable which
is set to another object, so if in interface builder you connect a
button to an outlet in your controller, the code equivalent is just to
make the button [ [ UIButton alloc ] init .. ] and then set the
controller member variable to that button. Actions are a little more
complicated but not very much more so, reading up on the event dispatch
for iPhone you'll quickly see how to register a selector for the given
action on a control.
I've found recently, as I understand the whole view controller model
that iPhone uses, my NIBs (built in interface builder) are little more
than a controller object and perhaps one small piece of customization,
it could be done in code very simply. IB really comes into its own when
developing for OS X where your interfaces can be quite complex, but for
iPhone with the limited number of components, mostly using full-screen
mode, code can work quite well.
_______________________________________________
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