-
Notifications
You must be signed in to change notification settings - Fork 67
/
main.m
32 lines (26 loc) · 994 Bytes
/
main.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
//
// main.m
// iPhoneTest2
//
// Created by Patrick Geiller on 12/10/08.
// Copyright __MyCompanyName__ 2008. All rights reserved.
//
#import <UIKit/UIKit.h>
#include "JavascriptCore-dlsym.h"
#include "JSCocoaController.h"
int main(int argc, char *argv[]) {
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
// Fetch JS symbols
[JSCocoaSymbolFetcher populateJavascriptCoreSymbols];
// Load iPhone bridgeSupport
[[BridgeSupportController sharedController] loadBridgeSupport:[NSString stringWithFormat:@"%@/iPhone.bridgesupport", [[NSBundle mainBundle] bundlePath]]];
// Load js class kit
id c = [JSCocoaController sharedController];
// [c evalJSFile:[NSString stringWithFormat:@"%@/class.js", [[NSBundle mainBundle] bundlePath]]];
// Load js main
[c evalJSFile:[NSString stringWithFormat:@"%@/iPhoneMain.js", [[NSBundle mainBundle] bundlePath]]];
// Start app
int retVal = UIApplicationMain(argc, argv, nil, nil);
[pool release];
return retVal;
}