Created
April 29, 2010 21:05
-
-
Save cappuccino/384242 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Objective-J / Objective-C differences: | |
1. No @interfaces, just combine the @interface with @implementation: | |
@implementation MyGreatClass : CPObject | |
{ | |
CPString myString; | |
} | |
- (id)init | |
{ | |
self = [super init]; | |
if (self) | |
{ | |
myString = @"hello"; | |
} | |
return self; | |
} | |
@end | |
2. No pointers (everything is a reference), and no more type declarations: | |
Instead of: | |
NSArray * x = [NSArray array]; | |
Do: | |
var x = [CPArray array]; | |
3. Instead of #import, use @import: | |
@import <Foundation/Foundation.j> | |
4. Instead of NS, use CP, only use CGRect (like iPhone) | |
myView = [[CPView alloc] initWithFrame:CGRectMake(0.0, 0.0, 100.0, 200.0)]; | |
And that's it (aside from being able to use all the features of JavaScript if you choose to do so as well of course). |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment