3 ms·
I would suggest Cocoa Programming for Mac OS X, even though it's based on Objective-C and the book is old. That means it's based upon older versions of Xcode an
by bluedino 4y ago
I would suggest Cocoa Programming for Mac OS X, even though it's based on Objective-C and the book is old. That means it's based upon older versions of Xcode and Mac OS (like ~10 years old). Conceptually it's a good book, but because of it's age the code examples, etc are outdated. The publisher does have forums which can be helpful:
https://forums.bignerdranch.com/c/cocoa-programming-for-os-x-5th-edition/9 https://forums.bignerdranch.com/c/cocoa-programming-for-os-x...
They also have a Swift book, but I haven't personally read it. They also have an Advanced Mac OS X book, but it's also old and isn't on their website anymore.
https://bignerdranch.com/books/ https://bignerdranch.com/books/
- Aqua_Geek 4y agoI would second this recommendation. This book is how I originally learned Objective-C and macOS development 20 years ago. It walks you through the fundamentals and provides a very good foundation for digesting the (archived) documentation from Apple.
- KerrAvon 4y agoThis is the best answer for hobby Mac programming for AppKit in Objective-C. As others have said, SwiftUI is the future and you might want to instead look at that if you can find a decent guide to it -- a lot of what's on the web is very badly obsolete already. It's a very different model. Folks, there will come a point where new UI features don't ship anymore for AppKit. Telling people not to learn SwiftUI is extremely counterproductive.
- newaccount74 4y agoSwiftUI is not usable yet on the Mac. I can't talk about its state on iOS, but on the Mac you will run into deal breaking limitations even for the most basic apps. If you want to make Mac apps, learn AppKit. You can use AppKit from Swift just fine, there's no need to use Objective C. Some of the text APIs are a bit cumbersome to use with Swift because of the different string semantics, but for the most part writing AppKit code in Swift is pretty sweet.
- kybernetyk 4y agoThis. You can also use SwiftUI inside NSHostingView. So you can do parts of your app in swift ui (preferences panel would be a good place to start). But for more involved stuff this is not production ready yet (except you want to do major reworks with each new SwiftUI revision).
- jcfields 4y agoI made a few simple Mac apps in Objective-C during the pandemic in 2020, and I was struck by how hard it was to find tutorials and examples on how to do anything in Objective-C. It's possible I was looking in all the wrong places, but it seems like everyone assumes you're using Swift at this point. I would advise against learning Mac development with Objective-C except to people who have a specific interest in it or need for it. I also think most people accustomed to newer programming languages would probably find it arcane in some areas and tedious in many others (although I personally like it for what it is and don't regret the time I spent with it, I definitely felt like I was making things harder on myself by using it).
- newaccount74 4y agoThere are three reasons for using Objective-C: - Performance: Sometimes the automatic conversion between Objective C and Swift types causes performance issues. Using Objective-C for some hot paths can be a lot faster. Sometimes just using NSString instead of String in Swift can also do the trick. - Legacy code: For most projects, there is no point in converting 100s of legacy Objective C classes to Swift. Just leave the old parts in Objective C, and call them from Swift. Rewriting just risks breaking stuff. - Interface with C/C++ code. Swift has some nice bridging that make calling C code easy (such as automatic conversion of swift strings), but some APIs like socket() are close to unusable in Swift, because they require complicated casts that are impossible to understand. Easier to write those parts in Objective C.
- sam0x17 4y ago> based upon older versions of Xcode and Mac OS (like ~10 years old). More crucially, I'd be curious what people's thoughts are on why the MacOS development community doesn't have newer resources like this.
- jocoda 4y ago2nded. Is there a macOs equivalent of the Windows Internals [0] books? I recently came across ImGui [1] which uses C++. I assume that cross platform software from Adobe, Microsoft, etc have C++ at their core and would love to find more in the way of resources for C++ on mac. Anyone? [0] https://www.amazon.com/Windows-Internals-Part-architecture-management/dp/0735684189/ref=sr_1_1?crid=1LRINS4S10KUH&keywords=Windows+internals&qid=1675764121&sprefix=windows+internals%2Caps%2C173&sr=8-1 https://www.amazon.com/Windows-Internals-Part-architecture-m... [1] https://github.com/ocornut/imgui https://github.com/ocornut/imgui