I'll throw in a +1. I've muddled through a few simple Mac apps but I'm pretty sure once I get into multiple window controllers, I'm probably doing things sub-optimally. I'd love a comprehensive, modern example that uses NSWindowController and other modern Cocoa bits.
This fork is the most active:
http://github.com/brotherbard/gitx
Personally, given your interests, I think getting into MacRuby at this
point is also a good way to invest your time. I think it's going to be
a major language for creating OSX apps.
Good luck!
/Felix
2010/10/28 alancfrancis <alancf...@gmail.com>:
I've dabbled with some simple Cocoa apps for my own use (nothing that is polished/complete enough to be sold on the Mac and then I wrote an iPhone app that sells ok given it's a niche app. I think I have a pretty good understanding of iPhone development since the design with multiple screens is pretty simple, but still don't feel confident about Mac design.
I'd also love to see a more advanced book talking about how to "properly" design apps with multiple windows and multiple controllers. Are you related to Aaron Hillegas? If so, perhaps you could talk him into a second volume of his great intro book! I think there's definitely a market for it as I have a medium sized Mac app I'd like to write for the Mac app store, but I'm concerned I don't have the proper design strategies down yet. I suspect there are many indie iPhone developers who would like to write Mac apps for the Mac App store.
I've read through Aaron Hillegas' book and actually sat down and did most of the examples/exercises in the first 11 or so chapters, but I still feel like I don't know what I should for larger projects. I tend to have a class I call AppModel that has access to the shared data the app needs and then in each class. I usually have the delegate have a pointer to it and then get access to it in other files via the [[NSApplication sharedApplication] delegate]. The few times I've created an application with more than one nib/window, I have the main window have pointers to the controllers for the other windows. I've never attempted to use multiple controllers within one window. Feel free to point out anything in the above that is a "bad design".
Thanks,
Dave
You can download an archive of the source from <http://bitbucket.org/billgarrison/docbasedwindowcontrollersappxcodetemplate/>.
I want to believe the code is clean and decipherable. YMMV.
There's no Core Data in this one. In theory, one could swap in NSPersistentDocument and go to town.
Bill
<http://bitbucket.org/billgarrison/sourcelistapplicationxcodetemplate/>
This Xcode project template generates a working app with a source list that drives variable window content. Illustrates how to embed a source list within window controller, and uses NSViewController for manage the window content view.
No Core Data in this one either. The application's model is managed old-school by the AppDelegate class. You could easily introduce a dedicated class to handle the app model data.
Bill
I've been tied up working for clients using tools and languages I'd
rather not mention here. That work ran out, so I sat down and began
to work on Cocoa/Cocoa Touch/Objective-C projects as fast as the free
time permits. It has been taking a lot of attention. I've been
collecting samples like a chipmunk collects nuts for the winter.
I have about 3 GB of stuff from all over.
I have about five or six apps in mind to code. Currently doing
generally lightweight projects without serious extras.
I'm currently using a nice library-in-progress called cocos2d-iphone:
http://www.cocos2d-iphone.org/. It is derived from a python package
called cocos2d, but rewritten for Objective-C and Cocoa/Cocoa Touch.
It supports iOS and Mac OS X now, so I presume the package is in for
a name change.
There are 300,000 or so apps in the App Store, you'll find every
viable framework out there. The cocos2d-iphone package is used for a
few 2d OpenGL-ES games.
The Omni folks do make some of their stuff available at
http://www.omnigroup.com/company/developer tho I haven't started to
look it over.