Developing for the Mac?


Recommended Posts

Great, thanks!

What about C++?  Is that used in OS X?

Mark

585803534[/snapback]

C++ can be used, but it's not nearly as native as Objective-C is to OS X. If I remember correctly, C++ will produce Carbon apps whereas Objective-C will produce Cocoa apps, even thought both can use Cocoa (e.g. Finder).

So it doesn't really matter if you use Cocoa or Carbon?  I read a while ago that Cocoa apps were slow and unstable.  I haven't seen anything like that with cocoa apps I use but just a question.

Thanks

Mark

585807595[/snapback]

Cocoa apps are the native type for OS X, so I don't understand why someone would say that (perhaps it was an old article you read?). Carbon apps can run on either OS 9 or OS X.

To say that Carbon isn't "OS X native" is a bit of a misleading unless these people are trying to say that programs like Finder are not "native". In some places Cocoa is falling back on Carbon calls (ie: Menus) so if Carbon application's aren't native, neither are ones written using Cocoa. They are different but one is not inferior to the other in and of itself. Much like operating systems the value of each is best determined by what you're trying to do. If you need a very dynamic GUI application fast then you'll probably want Cocoa, if you're concerned with speed and backward compatability with OS 9 users then you'll want Carbon. There's an article on O'reilly's Mac Developer Center about this so I won't bother making those same points. Carbon is not dead, it's not 'bad', and it's not out-dated: it's just got different strengths than Cocoa does.

There are four major languages used for OS X development these days:

  • C++
  • Objective C
  • Java
  • Objective C++

Python is getting a lot of attention lately and Apple finally poured a little love onto AppleScript Studio in 10.4 so you would do well to study either of those. The transition to OS X programming with Cocoa+Objective C will be easier if you already understand OOP concepts and SmallTalk. In 10.4 you would do well to study up on ERD diagrams: it can save you a lot of work. Most of the standard UNIX programming concepts work pretty well in OS X, if you have plans to write 64-bit applications then you should get comfortable with C/C++ programming and Pipes: there's really no other way to do it because Cocoa isn't 64-bit clean. If you know VB6 already then you can get a jump by ordering a copy of RealBASIC. I'm not sure why everyone seems to expect you to develop using Xcode now: powerplant & code warrior used to be perfectly fine

The three books I would most recommend are Sams? Cocoa Programming O'Reilly?s Learning Cocoa with Objective C and New Riders? Mac OS X programming.

The Sams book is an in-depth reference reference that covers not only how to use the IDE and APIs but also explains why Mac OS X is different from on other platoforms; for example, Cocoa force MVC patterns down your throat until you crap controller objects. I bought my copy when Project Builder was still the norm so (unless they've updated) be prepared to spend a few minutes mapping the old interface to the new while you work through examples.

The O'Reilly book is a little light on details. It's got a very accessible introduction to Core Foundation and Objective C and it introduces the debugging tools very early on but I found it to be more of a high-level overview of Mac OS X development rather than an in-depth guide to Cocoa.

I found ADC nearly useless as a 'getting started' resource. Once you're comfortable with how things work it's a respectable API reference and you can generally get the basics of unfamiliar/new APIs pretty quickly. That said, there are enough holes in the documentation that I don't think it's worth the $500+/year unless you take them up on offers like WWDC tickets or use of the testing facilities: the student membership has served me well enough.

To be honest I haven't finished the Carbon Book (Mac OS X Programming) but the parts I have read made it worth the $50 or so that I paid for it.

EDIT: I said "core foundation" when I meant foundation. Doh!

Edited by the evn show
This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.
  • Posts

    • It does invite Linux because MS should have been improving their products all along these years instead chose to ignore the users now this year they’re making all of these improvements to their products where as Linux doesn’t have this kind of problems in fact it has gotten so good I can even play Windows games in Steam that I no longer ever needed Windows to carry on with my life, unlike you still use Windows and chose to try beat down down those who don't use Windows because they love their LG TV. (Surprisingly I actually own a 55” LED LG TV and it has been going strong for almost 14 years, longer than any Sony TV”)
    • As much as I love owning my own hardware, it's hard to argue with the value. I'm not a huge gamer, I'd actually be interested in a cheaper plan with limited monthly hours, or even a pay-by-the-hour plan.
    • Well, they (LibreOffice/The Document Foundation) are bitchy and whiny, yes, but they're right, at least this time. It doesn't make sense to market something as "free and open source to thwart dependency on foreign companies' software" but at the same time, using the formats of said companies (Microsoft) by default. That way, you are changing nothing, essentially, you're just using another UI. We all know that users just use the defaults and almost never change them. I'm not saying they should drop other formats altogether, but they shouldn't default to the thing they're trying to run away from in the first place. If you're gonna do something, just go all the way in, don't stop in the middle, IMO. Otherwise, shut up and move along.
    • Words cannot express how much garbage this app is.
    • Vivaldi 8.0.4033.46 by Razvan Serea Vivaldi is a cross-platform web browser built for – and with – the web. A browser based on the Blink engine (same in Chrome and Chromium) that is fast, but also a browser that is rich in functionality, highly flexible and puts the user first. A browser that is made for you. Vivaldi is produced with love by a founding team of browser pioneers, including former CEO Jon Stephenson von Tetzchner, who co-founded and led Opera Software. Vivaldi’s interface is very customizable. Vivaldi combines simplicity and fashion to create a basic, highly customizable interface that provides everything a internet user could need. The browser allows users to customize the appearance of UI elements such as background color, overall theme, address bar and tab positioning, and start pages. Vivaldi features the ability to "stack" and "tile" tabs, annotate web pages, add notes to bookmarks and much more. Vivaldi 8.0.4033.46 fixes: [Chromium] Update to 148.0.7778.263 ESR (includes security fixes from 149.0.7827.102/103) Download: Vivaldi 64-bit | 139.0 MB (Freeware) Download: Vivaldi 32-bit | ARM64 View: Vivaldi Home Page | Screenshot Get alerted to all of our Software updates on Twitter at @NeowinSoftware
  • Recent Achievements

    • Week One Done
      FBSPL earned a badge
      Week One Done
    • One Year In
      Jim Dugan earned a badge
      One Year In
    • One Month Later
      Tommi118 earned a badge
      One Month Later
    • One Month Later
      sjbousquet earned a badge
      One Month Later
    • Week One Done
      sjbousquet earned a badge
      Week One Done
  • Popular Contributors

    1. 1
      +primortal
      487
    2. 2
      PsYcHoKiLLa
      196
    3. 3
      +Edouard
      155
    4. 4
      Steven P.
      84
    5. 5
      ATLien_0
      69
  • Tell a friend

    Love Neowin? Tell a friend!