Skip to content

Instantly share code, notes, and snippets.

@chandlerkent
Created June 3, 2009 15:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save chandlerkent/123034 to your computer and use it in GitHub Desktop.
Save chandlerkent/123034 to your computer and use it in GitHub Desktop.
/*
* AppController.j
* NewApplication
*
* Created by You on May 21, 2009.
* Copyright 2009, Your Company All rights reserved.
*/
@import <Foundation/CPObject.j>
@implementation AppController : CPObject
{
}
- (void)applicationDidFinishLaunching:(CPNotification)aNotification
{
var theWindow = [[CPWindow alloc] initWithContentRect:CGRectMakeZero() styleMask:CPBorderlessBridgeWindowMask],
contentView = [theWindow contentView];
// 2D Array
var multiDimensionalArray = [[CPArray alloc] initWithObjects:[[CPArray alloc] initWithObjects:@"test", @"test", @"test"], [[CPArray alloc] initWithObjects:@"one", @"two", @"three"]];
[[multiDimensionalArray objectAtIndex:1] replaceObjectAtIndex:2 withObject:@"hello"];
console.log(multiDimensionalArray);
// Or, in JS:
var multiDimensionalJSArray = [[@"test", @"test", @"test"], [@"one", @"two", @"three"]];
multiDimensionalJSArray[1][2] = @"hello";
console.log(multiDimensionalJSArray);
[theWindow orderFront:self];
// Uncomment the following line to turn on the standard menu bar.
//[CPMenu setMenuBarVisible:YES];
}
@end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment