Skip navigation.
 
mlRe: Bypassing Interface Builder
FROM : I. Savant
DATE : Thu May 15 02:43:19 2008

Graham, your responses were very well-put. I had to step away from 
this thread to meet some deadlines today and I'm glad to see where 
it's gone for the most part. I rushed to the defense of IB because, 
for what it is intended, it really is a powerful and useful tool. 
Unnecessary struggle is silly, more so on a device designed to 
eliminate just that.

  Now to my point:

> You probably didn't mean what you wrote, but if you did, then you 
> would have had trouble - IB doesn't *ever* want you to do this. You 
> drag FROM outlet TO control. You drag FROM control TO target + 
> action method. It's always FROM source TO destination.


  I'd like to expand on this a bit. It's important to think of 
"messaging objects" here. In Objective-C we are supposed to refer to a 
method call as a "message".

[someObject performSomeAction];

  In this sense, we can easily visualize a "flow" of messages from a 
sender to a receiver. In Interface Builder, this concept is key to 
understanding the "connections" you establish by ctl-dragging from one 
object to another.

  The two types of connections Interface Builder allows serve two 
different purposes to achieve and/or facilitate this flow. An IBOutlet 
gives you the ability to name an object instance so you can send it 
messages by name. An IBAction allows you "codelessly" specify both the 
target and action of a control.

  In the case of IBOutlet, an example of this is creating a 
"nextButton" outlet in an AssistantWindowController object and 
connecting an instance of it to a "Next" button in an assistant window 
so that you can enable or disable the button (or change its title to 
"Finish") when certain things happen (of course you can use Bindings 
for this). In this case, the owner of the outlet wants to be the sender.

  In the case of an IBAction, an example is the -nextPage: method of 
an "AssistantWindowController". Connecting the button's action to the 
AssistantWindowController's -nextPage: method means that when the 
button's action is fired, that AssistantWindowCotroller instance 
receives the -nextPage: action with the next button as its sender. In 
this case the owner of the action wants to be the receiver.

  Interface Builder is just a GUI tool (in two senses) that lets you 
instantiate views and controllers and wire them up with names and 
actions mostly through drag-and-drop. Doing so entirely in code is 
ridiculously tedious by comparison.

--
I.S.

Related mailsAuthorDate
mlBypassing Interface Builder colo May 14, 16:36
mlRe: Bypassing Interface Builder I. Savant May 14, 17:11
mlRe: Bypassing Interface Builder colo May 14, 17:35
mlRe: Bypassing Interface Builder I. Savant May 14, 17:43
mlRe: Bypassing Interface Builder Andy Lee May 14, 17:50
mlRe: Bypassing Interface Builder colo May 14, 17:53
mlRe: Bypassing Interface Builder I. Savant May 14, 17:58
mlRe: Bypassing Interface Builder David Wilson May 14, 17:59
mlRe: Bypassing Interface Builder I. Savant May 14, 18:01
mlRe: Bypassing Interface Builder I. Savant May 14, 18:05
mlRe: Bypassing Interface Builder Gregory Weston May 14, 18:06
mlRe: Bypassing Interface Builder glenn andreas May 14, 18:13
mlRe: Bypassing Interface Builder Wayne Packard May 14, 18:26
mlRe: Bypassing Interface Builder Andy Lee May 14, 18:37
mlRe: Bypassing Interface Builder Stefan Werner May 14, 18:46
mlRe: Bypassing Interface Builder Bill Bumgarner May 14, 19:00
mlRe: Bypassing Interface Builder Boyd Collier May 14, 19:34
mlRe: Bypassing Interface Builder colo May 14, 19:37
mlRe: Bypassing Interface Builder Julius Guzy May 14, 22:05
mlRe: Bypassing Interface Builder Torsten Curdt May 14, 22:49
mlRe: Bypassing Interface Builder colo May 15, 00:53
mlRe: Bypassing Interface Builder Graham Cox May 15, 01:26
mlRe: Bypassing Interface Builder Graham Cox May 15, 01:41
mlRe: Bypassing Interface Builder colo May 15, 02:14
mlRe: Bypassing Interface Builder Johnny Lundy May 15, 02:15
mlRe: Bypassing Interface Builder Graham Cox May 15, 02:29
mlRe: Bypassing Interface Builder I. Savant May 15, 02:43
mlRe: Bypassing Interface Builder Graham Cox May 15, 02:45
mlRe: Bypassing Interface Builder I. Savant May 15, 02:51
mlRe: Bypassing Interface Builder I. Savant May 15, 02:54
mlRe: Bypassing Interface Builder Andy Lee May 15, 03:02
mlRe: Bypassing Interface Builder Graham Cox May 15, 03:02
mlRe: Bypassing Interface Builder Andy Lee May 15, 03:06
mlRe: Bypassing Interface Builder I. Savant May 15, 03:07
mlRe: Bypassing Interface Builder Andy Lee May 15, 03:08
mlRe: Bypassing Interface Builder I. Savant May 15, 03:09
mlRe: Bypassing Interface Builder I. Savant May 15, 03:15
mlRe: Bypassing Interface Builder Andy Lee May 15, 03:29
mlRe: Bypassing Interface Builder Julius Guzy May 15, 03:35
mlRe: Bypassing Interface Builder I. Savant May 15, 03:37
mlRe: Bypassing Interface Builder Johnny Lundy May 15, 04:33
mlRe: Bypassing Interface Builder Julius Guzy May 15, 04:36
mlRe: Bypassing Interface Builder Johnny Lundy May 15, 04:54
mlRe: Bypassing Interface Builder Graham Cox May 15, 05:43
mlRe: Bypassing Interface Builder Uli Kusterer May 15, 07:50
mlRe: Bypassing Interface Builder Uli Kusterer May 15, 07:55
mlRe: Bypassing Interface Builder Uli Kusterer May 15, 08:15
mlcocoa mentoring (was Re: Bypassing Interface Builder) Torsten Curdt May 15, 15:36
mlRe: cocoa mentoring (was Re: Bypassing Interface Builder) Paul Bruneau May 15, 15:47
mlRe: cocoa mentoring (was Re: Bypassing Interface Builder) Uli Kusterer May 15, 16:08
mlcocoaheads frankfurt (was Re: cocoa mentoring) Torsten Curdt May 15, 16:44
mlRe: cocoa mentoring (was Re: Bypassing Interface Builder) Torsten Curdt May 15, 16:51
mlRe: Bypassing Interface Builder Andy Lee May 15, 17:11
mlRe: Bypassing Interface Builder Johnny Lundy May 15, 18:40
mlRe: cocoa mentoring (was Re: Bypassing Interface Builder) Dennis Munsie May 15, 19:34
mlRe: Bypassing Interface Builder Paul Sargent May 15, 20:07
mlRe: Bypassing Interface Builder Uli Kusterer May 15, 20:48
mlRe: Bypassing Interface Builder Shawn Erickson May 15, 22:20
mlRe: Bypassing Interface Builder Shawn Erickson May 15, 22:30
mlRe: Bypassing Interface Builder Johnny Lundy May 15, 22:32
mlRe: cocoa mentoring (was Re: Bypassing Interface Builder) Torsten Curdt May 15, 23:03