source: orbit/iOS/Orbit/Orbit/controllers/SupportViewController.m @ cef53d8

ServoTab_Interfacepyramid
Last change on this file since cef53d8 was cef53d8, checked in by Steve Castellotti <sc@…>, 9 years ago

Support:

  • working on local contact form
  • Property mode set to 100644
File size: 1.9 KB
RevLine 
[ab9d63b]1//
2//  SupportViewController.m
3//  orbit
4//
5//  Created by Jonathon Horsman on 11/07/2013.
6//  Copyright (c) 2013 Puzzlebox Productions, LLC. All rights reserved.
7//
8
9#import "SupportViewController.h"
10
11@implementation SupportViewController
12
13@synthesize webView, retryButton, status;
14
15- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
16{
17    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
18    if (self) {
19        // Custom initialization
20    }
21    return self;
22}
23
24- (void)viewDidLoad
25{
26    [super viewDidLoad];
27    [self loadSupportSite];
28}
29
[cef53d8]30#define BASEURL [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]
[ab9d63b]31- (void) loadSupportSite
32{
[d31bab4]33//    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: @"http://puzzlebox.info/forums/forumdisplay.php?fid=4"]]];
[cef53d8]34//    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: @"http://orbit.puzzlebox.info/contact"]]];
35
36   
37   NSString *urlAddress = [[NSBundle mainBundle] pathForResource:@"support" ofType:@"html"];
38   
39   NSURL *url = [NSURL fileURLWithPath:urlAddress];
40   NSURLRequest *requestObj = [NSURLRequest requestWithURL:url];
41   [webView loadRequest:requestObj];
42   
43   
[ab9d63b]44}
45
46#pragma mark UIWebViewDelegate methods
47
[ce0a7ee]48- (void)webViewDidFinishLoad:(UIWebView *)webView
[ab9d63b]49{
50    retryButton.hidden = YES;
51    status.hidden = YES;
52}
53
54- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error
55{
56    UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Not Connected" message:@"Unable to view support since you have no internet connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
57    [alert show];
58    retryButton.hidden = NO;
59    status.hidden = NO;
60    status.text = @"Unable to load support site";
61}
62
63#pragma mark button press methods
64
65- (IBAction) retryButtonPressed:(id) sender {
66    retryButton.hidden = YES;
67    status.text = @"Loading support website...";
68    [self loadSupportSite];
69}
70
71@end
Note: See TracBrowser for help on using the repository browser.