Cocoa Ruby

Loading...

Flash Player 9 (or above) is needed to view presentations.
We have detected that you do not have it on your computer. To install it, go here.

0 comments

Post a comment

    Post a comment
    Embed Video
    Edit your comment Cancel

    1 Favorite

    Cocoa Ruby - Presentation Transcript

    1. RubyCocoa introduction
      • presented by Chris Chan (iGPSD)
      • organized Cocoahead HK
    2. Ruby is ...
      • developed by Yukihiro “Matz” Matsumoto in the early 90’s
      • a object oriented scripting language
      • everything is an object ( example: 1.even? )
      • dynamic type script language
      • the foundation of well known web development framework ( Ruby on Rails )
    3. Objective-C ...
      • an object-oriented extension of C
      • a dynamically-typed language
      • use message handler rather than function call
      • add support of C++ and become Objective-C++
      • Objective-C++ supported by official GCC since gcc 4.1
    4. Cocoa is ...
      • a framework for building desktop applications
      • developed by NeXT in 1990’s
      • Apple adopt NeXT technology and built OSX
    5. RubyCocoa is ...
      • a bridge between the Objective-C and Ruby programming language
      • import the Objective-C classes on demand
      • work by forwarding Messages by using proxy objects
      • able to do the method overriding to Objective-C method
    6. History for RubyCocoa
      • started in 2001 by Hisakuni Fujimoto
      • in 2002, registered on SourceForge
      • in 2006, joined by developer from Apple, RubyCocoa presentation made during WWDC
      • in 2007, included and supported in Mac OSX Leopard
      information from wikipedia http://en.wikipedia.org/wiki/RubyCocoa
    7. RubyCocoa Usage
      • Ruby Script that make use of the native Cocoa API ( like make use of image preview to convert image )
      • Interactive to the system directly
      • use as a tool for prototyping as you can use irb to study the Cocoa in runtime
    8. RubyCocoa weakness
      • Performance is not as good as Objective-C/Cocoa Application
      • Ruby isn’t thread-safe, developer may need to handle concurrent update by using locks
      • Ruby cannot dispatch native threads
    9. How to get start
      • For developer using Mac OSX Leopard, you have built-in support for the RubyCocoa
      • For developer using Tiger or earlier, you can download and install RubyCocoa
        • svn co https://rubycocoa.svn.sourceforge.net/svnroot/rubycocoa/trunk rubycocoa
        • ruby install.rb config ruby install.rb setup sudo ruby install.rb install
    10. Syntax different between Objective-C and Ruby(I)
      • in Objective-C, sending a message named play to an object named sound [sound play];
      • in Ruby, the corresponding message sound.play
    11. Syntax different between Objective-C and Ruby(II)
      • in Objective-C, messages include arguments, the arguments are interleaved with tags that describe them [sound initWithContentsOfFile:filename byReference:false];
      • in Ruby, the corresponding message sound.initWithContentsOfFile(filename, :byReference, false) * argument tags are included as parameters of the message, in this case is “ byReference”
    12. Ruby irb
      • By using irb, you can try using rubycocoa
      • irb(main):001:0> require 'osx/cocoa' => true irb(main):002:0> s = OSX::NSString.stringWithString &quot;hello&quot; => #<OSX::OCObject:0x370976 class='NSCFString' id=0x114dee0> irb(main):003:0> s.objc_methods.sort => [&quot;CI_affineTransform&quot;, &quot;CI_copyWithZone:map:&quot;, &quot;CI_rect&quot;, &quot;UTF8String&quot;, ... http://www.rubycocoa.com/an-introduction-to-rubycocoa/4
    13. Example Code
      • Example code provided by Apple can found in here /Developer/Examples/Ruby/RubyCocoa/
    14. ActiveRecord Binding Example /Developer/Examples/Ruby/RubyCocoa/MailDemo/MailDemoActiveRecordBindings/
    15. RealTime Image filter Demo
      • /Developer/Examples/Ruby/RubyCocoa/CITransitionSelectorSample
    16. You can build the next Clip it!
      • /Developer/Examples/Ruby/RubyCocoa/MiniBrowser
    17. More resource
      • http://www.rubycocoa.com They have many great tutorial for beginner like me
      • http://rubycocoa.sourceforge.net/HomePage The latest Source for RubyCocoa
    18. Books
      • Cocoa(R) Programming for Mac(R) OS X (3rd Edition) http://www.amazon.com/exec/obidos/ASIN/0321503619/bignerdranch-20
      • Ruby Cocoa ( beta book ) expected release date Nov 2008 http://www.pragprog.com/titles/bmrc/rubycocoa
    19. About US
      • iGPSD - GPS for iPhone we are the first company selling the hardware GPS navigation solution to iPhone users
      • over 500 unit of GPS cable sold in 3 months
      • Demo Video : http://www.youtube.com/watch?v=3o2zjs3wXmI
    20. Q&A
      • Our blog : http://igpsd.wordpress.com /
      • Our Online Store : http://store.igpsd.com /

    moming2kmoming2k, 10 months ago

    custom

    683 views, 1 favs, 0 embeds more stats

    More Info

    © All Rights Reserved

    Go to text version
    • Total Views 683
      • 683 on SlideShare
      • 0 from embeds
    • Comments 0
    • Favorites 1
    • Downloads 10
    Most viewed embeds

    more

    All embeds

    less

    Flagged as inappropriate Flag as inappropriate
    Flag as innappropriate

    Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

    Cancel

    Categories