Good Resources to Learn MACruby

Good resources to learn MacRuby

I found MacRuby: The Definitive Guide, by Matt Aimonetti
very helpful for getting started with MacRuby.

Tips for an iOS developer to learn Mac programming?

Highly recommend Cocoa Programming for Mac OSX by Aaron Hillegass .

This is a great starting point,as you are already an iOS programmer,it wouldn't be tough.

What is the best cocoa book for desktop mac development?

  1. Cocoa Programming for Mac OS X is generally regarded as "the bible" of desktop Cocoa development.
  2. Objective-C is all you need, for the most part. Very rarely will you need a more domain-specific language. There are more options (MacRuby, PyObjC, Java, REALbasic, etc), but it's extremely common to do everything in Objective-C.
  3. Any "lockdown" on the desktop would be defined by the app store approval process and the permissions you can acquire from the user.
  4. Apps are not sandboxed on the Mac.

Runtime error trying to use CoreGraphics with MacRuby

Okay, so after a lot of help from @jballanc on the #macruby IRC client, we determined that this is a Mountain Lion-specific problem caused by some changes to the way CoreGraphics is packaged in the latest XCode. Here's how to solve it if you're running into it:

  1. Regenerate your Bridge Support files for both CoreGraphics and ApplicationServices, using something like:


    gen_bridge_metadata --64-bit -f /System/Library/Frameworks/CoreGraphics.framework/ -o /System/Library/Frameworks/CoreGraphics.framework/Resources/BridgeSupport/CoreGraphics.bridgesupport

  2. In Mountain Lion, you will need to explicitly load the CoreGraphics framework from your MacRuby code -- but in versions previous to Mountain Lion, doing so will crash. So you'll need something like the following check:


    framework 'CoreGraphics' if (/12/ =~ `uname -r`) == 0

  3. Depending on your environment, you may or may not need to explicitly link against ApplicationServices.framework in your XCode project settings.

Doing all of the above allowed me and my Snow Leopard-using partner to share the same code base and have it work for both of us.

Where is ruby stored on mac?

You can get the path to the local executable with

$ which ruby

the rvm rubies are in your rvm directory, which I believe is ~/.rvm/rubies (I use rbenv so not sure about the details)

The which command should pickup whatever shims/other magic RVM is using to set your shell ruby

Utilizing resources of separate apps on OS X

It's still rather up to what each app will let you do, rather than just being able to do anything, but take a look at OS X's scripting/automation abilities. Primarily this is accessed through AppleScript, but there's now a JavaScript frontend as well (new to Yosemite).

If you're looking at building a native application that takes advantage of other applications, the same scripting abilities can also be reached via the Scripting Bridge from Cocoa (Objective-C/Swift).



Related Topics



Leave a reply



Submit