Hallo,
ich hab ein kleines Problem mit meinen Voids, keines davon geht mehr.
Weder die Notifikation noch der ActivityIndicator gehen,... jemand eine Idee?
Bin leider als Anfänger mit meinem Latein am ende...
ViewController.h
Alles anzeigen
ViewController.m
Alles anzeigen
ich hab ein kleines Problem mit meinen Voids, keines davon geht mehr.
Weder die Notifikation noch der ActivityIndicator gehen,... jemand eine Idee?
Bin leider als Anfänger mit meinem Latein am ende...
ViewController.h
Quellcode
- #import <UIKit/UIKit.h>
- @interface ViewController : UIViewController {
- IBOutlet UIWebView *webview;
- IBOutlet UIActivityIndicatorView *active;
- UIAlertView *alert_start;
- UIAlertView *alert_error;
- }
- -(IBAction)tele_button:(id)sender;
- -(IBAction)mail_button:(id)sender;
- -(IBAction)web_button:(id)sender;
- -(IBAction)news_button:(id)sender;
- @end
ViewController.m
Quellcode
- @implementation ViewController
- - (void)didReceiveMemoryWarning
- {
- [super didReceiveMemoryWarning];
- // Release any cached data, images, etc that aren't in use.
- }
- #pragma mark - View lifecycle
- - (void)viewDidLoad
- {
- [super viewDidLoad];
- //Stop Bounce for WebView
- for (id subview in webview.subviews)
- if ([[subview class] isSubclassOfClass: [UIScrollView class]])
- ((UIScrollView *)subview).bounces = NO;
- //First Start Alert
- [alert_start show];
- NSString *start_alert = [[NSUserDefaults standardUserDefaults] objectForKey:@"alert_start"];
- if(start_alert == nil)
- {
- [[NSUserDefaults standardUserDefaults] setValue:@"1" forKey:@"alert_start"];
- [[NSUserDefaults standardUserDefaults] synchronize];
- UIAlertView *alert_start = [[UIAlertView alloc] initWithTitle:@"LoreIpsum"
- message:@"LoreIpsum Lore Ipsum."
- delegate:self
- cancelButtonTitle:@"OK"
- otherButtonTitles:nil];
- [alert_start show];
- [alert_start release];
- }
- // Do any additional setup after loading the view, typically from a nib.
- [webview loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"home-de" ofType:@"html"]isDirectory:NO]]];
- NSLog(@"webview fertig");
- }
- -(void)webViewDidStartLoad:(UIWebView *) webview {
- [UIApplication sharedApplication].networkActivityIndicatorVisible = YES;
- [active startAnimating];
- NSLog(@"lade");
- }
- -(void)webViewDidFinishLoad:(UIWebView *) webview {
- [UIApplication sharedApplication].networkActivityIndicatorVisible = NO;
- [active stopAnimating];
- NSLog(@"fertig");
- }
- -(void)webView: (UIWebView *) webview didFailLoadWithError:(NSError *)error{
- NSLog(@"lade error");
- UIAlertView *alert_error = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Can't connect. Please check your internet connection" delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
- [alert_error show];
- [alert_error release];
- };
- //- (IBAction)tele_button:(id)sender;{
- // [[UIApplication sharedApplication] openU RL:[NSURL URLWithString:@"tel://00000000"]];
- - (IBAction)tele_button:(id)sender{
- NSLog(@"it's connected!");
- //Local HTML Call Button
- NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"phone" ofType:@"html"]isDirectory:NO]];
- [self->webview loadRequest:theRequest];
- }
- - (IBAction)mail_button:(id)sender{
- NSLog(@"it's connected!");
- //Mail App Mail Button
- [[UIApplication sharedApplication] openURL:[NSURL URLWithString:@"mailto://info@loreipsum"]];
- }
- - (IBAction)web_button:(id)sender{
- NSLog(@"it's connected!");
- //Local HTML Button
- NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL URLWithString: @"http://lore.com"]];
- [self->webview loadRequest:theRequest];
- }
- - (IBAction)news_button:(id)sender{
- NSLog(@"it's connected!");
- //local Home Button
- NSURLRequest *theRequest = [NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"home-de" ofType:@"html"]isDirectory:NO]];
- [self->webview loadRequest:theRequest];
- }