aboutsummaryrefslogtreecommitdiffstats
path: root/phonegap/iPhone/FixMyStreet/Classes/MainViewController.m
diff options
context:
space:
mode:
authorStruan Donald <struan@exo.org.uk>2012-06-08 18:13:00 +0100
committerStruan Donald <struan@exo.org.uk>2012-06-08 18:13:00 +0100
commitb06bf2f56262fe7c77c381cd2b4226362dd55e16 (patch)
tree12d5ded748d54c7807a28083eb1dc4a908d3dc6a /phonegap/iPhone/FixMyStreet/Classes/MainViewController.m
parente3856e704ac8ae7731e24d49d43b9acd2dbe0098 (diff)
upgrade to phonegap 1.8
Diffstat (limited to 'phonegap/iPhone/FixMyStreet/Classes/MainViewController.m')
-rw-r--r--phonegap/iPhone/FixMyStreet/Classes/MainViewController.m84
1 files changed, 77 insertions, 7 deletions
diff --git a/phonegap/iPhone/FixMyStreet/Classes/MainViewController.m b/phonegap/iPhone/FixMyStreet/Classes/MainViewController.m
index ef5d1c0be..289da3596 100644
--- a/phonegap/iPhone/FixMyStreet/Classes/MainViewController.m
+++ b/phonegap/iPhone/FixMyStreet/Classes/MainViewController.m
@@ -19,9 +19,9 @@
//
// MainViewController.h
-// FixMyStreet
+// cordova1.8.0
//
-// Created by Struan Donald on 08/03/2012.
+// Created by Struan Donald on 08/06/2012.
// Copyright __MyCompanyName__ 2012. All rights reserved.
//
@@ -29,7 +29,7 @@
@implementation MainViewController
-- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
+- (id) initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
@@ -38,7 +38,7 @@
return self;
}
-- (void)didReceiveMemoryWarning
+- (void) didReceiveMemoryWarning
{
// Releases the view if it doesn't have a superview.
[super didReceiveMemoryWarning];
@@ -48,23 +48,93 @@
#pragma mark - View lifecycle
-- (void)viewDidLoad
+- (void) viewDidLoad
{
[super viewDidLoad];
// Do any additional setup after loading the view from its nib.
}
-- (void)viewDidUnload
+- (void) viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}
-- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
+- (BOOL) shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
// Return YES for supported orientations
return [super shouldAutorotateToInterfaceOrientation:interfaceOrientation];
}
+/* Comment out the block below to over-ride */
+/*
+- (CDVCordovaView*) newCordovaViewWithFrame:(CGRect)bounds
+{
+ return[super newCordovaViewWithFrame:bounds];
+}
+*/
+
+/* Comment out the block below to over-ride */
+/*
+#pragma CDVCommandDelegate implementation
+
+- (id) getCommandInstance:(NSString*)className
+{
+ return [super getCommandInstance:className];
+}
+
+- (BOOL) execute:(CDVInvokedUrlCommand*)command
+{
+ return [super execute:command];
+}
+
+- (NSString*) pathForResource:(NSString*)resourcepath;
+{
+ return [super pathForResource:resourcepath];
+}
+
+- (void) registerPlugin:(CDVPlugin*)plugin withClassName:(NSString*)className
+{
+ return [super registerPlugin:plugin withClassName:className];
+}
+*/
+
+#pragma UIWebDelegate implementation
+
+- (void) webViewDidFinishLoad:(UIWebView*) theWebView
+{
+ // only valid if ___PROJECTNAME__-Info.plist specifies a protocol to handle
+ if (self.invokeString)
+ {
+ // this is passed before the deviceready event is fired, so you can access it in js when you receive deviceready
+ NSString* jsString = [NSString stringWithFormat:@"var invokeString = \"%@\";", self.invokeString];
+ [theWebView stringByEvaluatingJavaScriptFromString:jsString];
+ }
+
+ // Black base color for background matches the native apps
+ theWebView.backgroundColor = [UIColor blackColor];
+
+ return [super webViewDidFinishLoad:theWebView];
+}
+
+/* Comment out the block below to over-ride */
+/*
+
+- (void) webViewDidStartLoad:(UIWebView*)theWebView
+{
+ return [super webViewDidStartLoad:theWebView];
+}
+
+- (void) webView:(UIWebView*)theWebView didFailLoadWithError:(NSError*)error
+{
+ return [super webView:theWebView didFailLoadWithError:error];
+}
+
+- (BOOL) webView:(UIWebView*)theWebView shouldStartLoadWithRequest:(NSURLRequest*)request navigationType:(UIWebViewNavigationType)navigationType
+{
+ return [super webView:theWebView shouldStartLoadWithRequest:request navigationType:navigationType];
+}
+*/
+
@end