iPhone Developer => Mac Developer

27 views
Skip to first unread message

alancfrancis

unread,
Oct 28, 2010, 10:00:50 AM10/28/10
to cocoa-unbound
Hi folks,

I'm a reasonably experienced iPhone programmer and I've been looking
for some time to make the transition to Mac desktop development.

In fact, when I got my first Mac in 2004 (a 15" G4 PowerBook), one of
my reasons for buying it were to get into development with more
dynamic technologies and languages (Smalltalk, Ruby and ObjectiveC),
away from the previous 15 years of C, C++ and Java.

For a variety of reasons, the ObjC part of that never quite happened
(Ruby kind of took over) and it wasn't until the iPhone that I had an
environment that was constrained enough that I could focus on learning
ObjC and some Cocoa patterns and not get lost in the overall
application architecture. One ViewController at a time (and one NIB
per ViewController) was a nice, safe way to build applications while
learning the libraries.

Early this year I decided I wanted to really make a move into Mac
application development and have a couple of pet projects in mind.
I'm still no further forward really, and I think I know what the
problem is.

When I create a new Rails application or Ruby Gem, there's a clear,
predefined application structure. Its obvious what things go where.
It's the same structure every time,

When I first created new iPhone projects, picking a "Navigation-based
app" or suchlike gave you all the structure you'd really need for that
type of app. You could see exactly where the VCs lived, how they
hooked up to NIBs and how they talked to each other. I don't need the
templates now, but they were *very* instructive in the beginning.

I'm missing the same thing for Mac applications.

When I create a new project, and I have a picture in my mind of what I
want to create, I've no real guidance of where to start with the
relationships between Window and View Controllers, controllers to
NIBs, etc.

In the end, what I believe will help me is to poke around a real,
proper (say) iTunes-like Mac application. A GUI with communicating
different Views/ViewControllers, CoreData storage, network updates of
those objects, maybe some GCD etc. As an Extreme Programmer I'll give
bonus points for a decent suite of Unit Tests :)

A few ways I could get this (in vague order of usefulness)

1/ At the most basic, an overview session like WWDC session 125 from
2009 "Effective iPhone Application Architecture" but for Mac apps.
Loved this session.

2/ A Book that builds an app like that over chapters, rather than toy
examples per chapter.

3/ A set of screencasts on the same topic.

4/ A "training course" building the guts of something like this over a
week. A tall order, but even if several of the "child" controllers
are left as an exercise for the student, the overall structure/
architecture should be clear. I *don't* need to spend the first two
days learning about ObjectiveC basics.

5/ Access to the source of a (well-written) app like that. Are there
any decent (modern) open source applications available ?

6/ A week or two of "consultancy" where I get to pair with an
experienced Mac developer for the first two weeks of the project and
get the structure in place.

I'm always reluctant to use the word architecture because it makes me
think of diagrams and they only take you so far - I want to grok the
*code* - but I think architecture may be the best word for what I'm
needing some guidance with.

Anyway, any more and I'll start rambling. Help, suggestions, links
all welcome.

Thanks!

Alan

Hunter Hillegas

unread,
Oct 28, 2010, 10:34:53 AM10/28/10
to cocoa-...@googlegroups.com
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.

alancfrancis

unread,
Oct 28, 2010, 10:37:53 AM10/28/10
to cocoa-unbound
Small update: Jonathan Branam on Twitter suggested Limechat (
http://github.com/psychs/limechat )

Haven't looked at it yet. Github lets me search by language, but most
of what it finds is iOS or libs/frameworks. It'd be hard to find an
app unless someone sends you a link.

Patrick Burleson

unread,
Oct 28, 2010, 10:38:54 AM10/28/10
to cocoa-...@googlegroups.com
On Thu, Oct 28, 2010 at 9:34 AM, Hunter Hillegas <li...@lastonepicked.com> wrote:
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.


You've reminded me of two blog posts from the past year that covered creating a modern Mac app:



They both build the same app, but with slightly different approaches. Maybe looking at those will start the wheels turning for you.

Patrick

alancfrancis

unread,
Oct 28, 2010, 10:40:17 AM10/28/10
to cocoa-unbound
On Oct 28, 3:34 pm, Hunter Hillegas <li...@lastonepicked.com> wrote:
> 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.

I suggested on Twitter that @wilshipley should charge an hourly rate
for readonly access to the Library codebase. If we could disable
cut'n'paste so all I could do was look and take notes with a pen, I'm
sure that'd be fair enough :-)

Alan

Billy Gray

unread,
Oct 28, 2010, 10:54:17 AM10/28/10
to cocoa-...@googlegroups.com
+1 here, as well. The more I learn, the more I get why things are so loosely coupled, but it can be a bit dizzying to sort out at times.

I found Matt Gallagher's article "The Design of Every Mac Application" pretty instructive [1], although I'm in agreement with Alan that some more comprehensive material would be invaluable, especially if it came from The Source. 

Perhaps some of the more experienced Cocoa hackers could make some bank doing PeepCode-style tutorials and screen-casts?

Billy

Felix Holmgren

unread,
Oct 28, 2010, 11:47:38 AM10/28/10
to cocoa-...@googlegroups.com
Gitx is a cool open source app with lots of users. One of the best git
UIs around. It has a number of issues of various degrees of
difficulty, and it is a reasonably small project that you can start
contributing quickly. There is also any number of additional features
you could add. If you are familiar with git, just pick out some of
your favorite features and think about how a great frontend would
look. It has a good xib setup and does scripting with web views,
sending info back and forth between Javascript and the objc code and
has a number of other interesting features.

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>:

David Reed

unread,
Oct 30, 2010, 5:44:54 PM10/30/10
to cocoa-...@googlegroups.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

Fernando Barajas

unread,
Oct 28, 2010, 10:56:47 AM10/28/10
to cocoa-...@googlegroups.com
What I've done in the past was look at Adium and Colloquy and try to understand what was happening.
And recently I got a better understanding of CoreData with a training course video provided by "http://ideveloper.tv/"

Bill Garrison

unread,
Nov 2, 2010, 12:29:24 PM11/2/10
to cocoa-...@googlegroups.com
I have an Xcode project template that generates an application using the NSDocument architecture and NSWindowControllers. It demonstrates the bare minimum for a doc-based app that uses window controllers for presenting main window content and a separate inspector window. Also sports a toolbar! :-), illustrating use of the responder chain.

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

Bill Garrison

unread,
Nov 2, 2010, 12:38:48 PM11/2/10
to cocoa-...@googlegroups.com
If you're looking for a simple source list-based application, There's a Template for That.™

<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

Michael Brian Bentley

unread,
Nov 8, 2010, 3:01:22 AM11/8/10
to cocoa-...@googlegroups.com

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.

Reply all
Reply to author
Forward
0 new messages