forked from newyankeecodeshop/GAJavaScript
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApplicationDelegate.m
More file actions
43 lines (31 loc) · 1.04 KB
/
ApplicationDelegate.m
File metadata and controls
43 lines (31 loc) · 1.04 KB
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
33
34
35
36
37
38
39
40
41
42
43
//
// ApplicationDelegate.m
// GAJavaScript
//
// Created by Andrew on 5/9/11.
// Copyright 2011 Wingspan Technology, Inc. All rights reserved.
//
#import "ApplicationDelegate.h"
#import "GAScriptEngine.h"
@implementation ApplicationDelegate
@synthesize scriptEngine = _scriptEngine;
- (void)dealloc
{
[_scriptEngine release];
[super dealloc];
}
- (void)applicationDidFinishLaunching:(UIApplication *)application
{
[super applicationDidFinishLaunching:application];
CGRect webFrame = [[UIScreen mainScreen] applicationFrame];
UIWebView* webView = [[UIWebView alloc] initWithFrame:webFrame];
webView.tag = 9999;
webView.hidden = YES;
[window_ addSubview:webView];
_scriptEngine = [[GAScriptEngine alloc] initWithWebView:webView];
NSString* filePath = [[NSBundle mainBundle] pathForResource:@"TestWebViewContent" ofType:@"html"];
NSString* html = [[NSString alloc] initWithContentsOfFile:filePath encoding:NSUTF8StringEncoding error:nil];
[webView loadHTMLString:html baseURL:nil];
[html release];
}
@end