开发者

Need recommandations for Cocoa Tutorials for programatic development of Mac applications

I am new to Mac OS application development. I am quite familiar with iPhone application development. But I am confused about creating windows, table views and other things in Mac application. I saw some tutorials teaching those things using IB. But I want to learn to do these programatically.

In iPhone we can create View Controller and add it to window or to a navigation controller which can be added to window. I need to know how to do similar things in Mac. Can 开发者_开发百科anyone suggest/recommend me some beginners tutorials which teach programmatic development of Mac applications..

Don't blame me for this simple/very-basic/whatever-you-think-worst-about-this-question question. I have been googling on this topic about a week now. I cant able to find what I need. I always appreciate your help.

Thanks everyone..


there's nothing magical about IB. it doesn't add any functionality apart from the ability to view and edit dynamic types in a WYSIWYG manner. it uses all the functionalities of the class interfaces, as well as some Cocoa internals (which are visible enough to you - things like bindings and archiving).

the biggest runtime difference lies in how objects (e.g. NSViews) are created. with nibs, you get nib unarchiving, rather than [[MONView alloc] initWithFrame:r].

you really won't need much wrt tutorials if you're already comfortable with the language/patterns. typically, you'll just look for properties with the same name and define it there. additionally, you'll implement your own initWith methods, rather than NSCoder+awakeFromNib methods. it's really very simple once you understand how IB unarchives the nib.

so... as a starting point, i'd recommend converting functional nibs to functional programmatic implementations. along the way, you'll have to look up a few methods to understand how to manipulate and construct NSView graphs -- how to convert what you know in IB to source representations.

i really don't know of a specific resource, my point is that it is easier than you may believe. sure, there are a few pubs which demonstrate this briefly - but the ones i know of quickly demonstrate it in a few cases as proof of concept and then continue the tutorials using IB.

the best singular resource i know of for this is Cocoa Programming (Anguish/Buck/Yacktman) - perhaps that is dated or has been revised. the last rev i know of is from 2002.

lastly, you may get a lot of people telling you what a horrible idea it is to not use IB. if you want to do serious development and you already understand IB, i think it's a great skill and it is very useful for me - particularly for complex apps and large codebases. for simple apps, it doesn't matter much. i rarely create/use nibs - i just implement it programmatically in the majority of cases. i find it cleaner, faster, and less redundant. also, i have a ton of custom implementations and use objc++ so... IB isn't really that much help when you're that far from the mainline.

good luck!

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜