Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

dale.albiston

macrumors member
Original poster
Sep 29, 2006
61
0
quick question.

Am I right in thinking its normal for each window in a cocoa application to basically have at least two parts, the 'nib' file containing the actual form and a custom 'control' object the handles the interface with the actual application as well as custom function code for the window?

Only asking since I'm more used to vb, which for all its faults is very simple to use.

not knocking xcode, I actually like it just trying to get my head round the way it works.
 

whooleytoo

macrumors 604
Aug 2, 2002
6,607
716
Cork, Ireland.
More or less true, yes. Of course, you could have several nibs (many applications do); and one controller object per window, or one controller for several windows.

I've always thought it a pity Apple haven't integrated Xcode and IB - having to manually 'sync' between the two (as in, if you create a new outlet in code, you have to drag the file to IB to inform it of the outlet; or if you create an outlet in IB you may need to merge the code files manually, which can be tricky).
 

dale.albiston

macrumors member
Original poster
Sep 29, 2006
61
0
Cheers I figured this was intentional, and not an oversight, basically cus while its long winded it actually works well.

just nice to know I'm reading it right.

and the tip on how to tell IB about new outlets etc is most welcome, i've been adding them manually in both IB and XCode.... it works but.. um.. well my goof.

kinda like the 'merge' feature, which appears to hate me personally. but I'll get there.
 

kpua

macrumors 6502
Jul 25, 2006
294
0
and the tip on how to tell IB about new outlets etc is most welcome, i've been adding them manually in both IB and XCode.... it works but.. um.. well my goof.

I personally prefer the drag-the-header-file-onto-the-IB-window method to do this myself. For me, it's easier to just create the outlets and actions in code and have IB create all the entries its little tableviews for me, rather than do it the other way around which is somewhat clunky and requires the whole hassle of merging. This isn't the easiset thing in the world, but considering the options, that's what I always do.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.