Skip to content

Commit

Permalink
README++
Browse files Browse the repository at this point in the history
  • Loading branch information
TooTallNate committed Jul 22, 2012
1 parent 31327b1 commit 616d816
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions README.md
Expand Up @@ -33,15 +33,17 @@ Install using `npm`, of course!
$ npm install NodObjC
```

Or add it to the `"dependencies"` section of your _package.json_ file.


Hello World
-----------

``` javascript
var $ = require('NodObjC')

// First you need to "import" the Framework
$.import('Foundation')
// First you import the "Foundation" framework
$.framework('Foundation')

// Setup the recommended NSAutoreleasePool instance
var pool = $.NSAutoreleasePool('alloc')('init')
Expand All @@ -50,13 +52,15 @@ var pool = $.NSAutoreleasePool('alloc')('init')
// NSString from a JS String when an Objective-C class method requires one.
var string = $.NSString('stringWithUTF8String', 'Hello Objective-C World!')

// Print out the contents (calling [string description])
// Print out the contents (toString() ends up calling [string description])
console.log(string)
// → Prints "Hello Objective-C World!"

pool('drain')
```

Be sure to check out the [full API docs][docs].


Introduction
------------
Expand Down Expand Up @@ -126,6 +130,7 @@ to check out the [#nodobjc][IRC] channel in the freenode IRC server.
Additional topics of discussion can be found on the [Wiki][] page.


[docs]: http://tootallnate.github.com/NodObjC/
[NodeJS]: http://nodejs.org
[JSCocoa]: http://inexdo.com/JSCocoa
[PyObjC]: http://pyobjc.sourceforge.net
Expand Down

0 comments on commit 616d816

Please sign in to comment.