Browse files

readme's can't be as cool as they are on the wiki :(

  • Loading branch information...
1 parent 6f3b8af commit 3756effa002f3e69f27fb30534ba20512cbe2b1e @probablycorey committed Jan 12, 2011
Showing with 0 additions and 12 deletions.
  1. +0 −12
@@ -30,36 +30,29 @@ For some simple Wax apps, check out the [examples folder](
How would I create a UIView and color it red?
-- forget about using alloc! Memory is automatically managed by Wax
view = UIView:initWithFrame(CGRect(0, 0, 320, 100))
-- use a colon when sending a message to an Objective-C Object
-- all methods available to a UIView object can be accessed this way
What about methods with multiple arguments?
-- Just add underscores to the method name, then write the arguments like
-- you would in a regular C function
UIApplication:sharedApplication():setStatusBarHidden_animated(true, false)
How do I send an array/string/dictionary
-- Wax automatically converts array/string/dictionary objects to NSArray,
-- NSString and NSDictionary objects (and vice-versa)
images = {"myFace.png", "yourFace.png", "theirFace.png"}
imageView = UIImageView:initWithFrame(CGRect(0, 0, 320, 460))
What if I want to create a custom UIViewController?
-- Created in "MyController.lua"
-- Creates an Objective-C class called MyController with UIViewController
@@ -76,11 +69,9 @@ What if I want to create a custom UIViewController?
function viewDidLoad()
-- Do all your other stuff here
You said HTTP calls were easy, I don't believe you...
url = ""
-- Makes an asyncronous call, the callback function is called when a
@@ -93,16 +84,13 @@ You said HTTP calls were easy, I don't believe you...
-- it into a Lua table
Since Wax converts NSString, NSArray, NSDictionary and NSNumber to native Lua values, you have to force objects back to Objective-C sometimes. Here is an example.
local testString = "Hello lua!"
local bigFont = UIFont:boldSystemFontOfSize(30)
local size = toobjc(testString):sizeWithFont(bigFont)
Setup & Tutorials

0 comments on commit 3756eff

Please sign in to comment.