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

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

Support:

  • working on local contact form
  • Property mode set to 100644
File size: 1.9 KB
Line 
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
30#define BASEURL [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]
31- (void) loadSupportSite
32{
33//    [webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString: @"http://puzzlebox.info/forums/forumdisplay.php?fid=4"]]];
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   
44}
45
46#pragma mark UIWebViewDelegate methods
47
48- (void)webViewDidFinishLoad:(UIWebView *)webView
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.