- Registriert
- 30.05.14
- Beiträge
- 107
Hallo zusammen,
Es geht darum: Ich habe eine Cocoa App gemacht mit einem WebView. Das heißt wenn man die App öffnet wird eine bestimmte Webseite geladen. Das funktioniert bisher, aber ich möchte in den Einstellungen ein Textfeld haben in dieses man eintippen kann welche Seite im WebView angezeigt wird.
Vielen Dank für Eure Hilfe!
Der Code sieht bisher wie folgt aus:
AppDelegate.h:
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
@interface AppDelegate : NSObject <NSApplicationDelegate> {
WebView *WebView;
//other instance variables
}
@property
(retain, nonatomic) IBOutletWebView *WebView;
@property
(retain, nonatomic) IBOutletWebView *FeedbackView;
//other properties and methods
@end
AppDelegate.m:
#import "AppDelegate.h"
#import <WebKit/WebKit.h>
@implementation AppDelegate
- (void)applicationDidFinishLaunching
NSNotification *)aNotification
{
NSString *urlText = @"http://google.de";
[[self.WebViewmainFrame] loadRequest:[NSURLRequestrequestWithURL:[NSURLURLWithString:urlText]]];
return;
}
- (BOOL)applicationShouldTerminateAfterLastWindowClosed
NSApplication *)theApplication {
returnYES;
}
@end
Es geht darum: Ich habe eine Cocoa App gemacht mit einem WebView. Das heißt wenn man die App öffnet wird eine bestimmte Webseite geladen. Das funktioniert bisher, aber ich möchte in den Einstellungen ein Textfeld haben in dieses man eintippen kann welche Seite im WebView angezeigt wird.
Vielen Dank für Eure Hilfe!
Der Code sieht bisher wie folgt aus:
AppDelegate.h:
#import <Cocoa/Cocoa.h>
#import <WebKit/WebKit.h>
@interface AppDelegate : NSObject <NSApplicationDelegate> {
WebView *WebView;
//other instance variables
}
@property
(retain, nonatomic) IBOutletWebView *WebView;
@property
(retain, nonatomic) IBOutletWebView *FeedbackView;
//other properties and methods
@end
AppDelegate.m:
#import "AppDelegate.h"
#import <WebKit/WebKit.h>
@implementation AppDelegate
- (void)applicationDidFinishLaunching

{
NSString *urlText = @"http://google.de";
[[self.WebViewmainFrame] loadRequest:[NSURLRequestrequestWithURL:[NSURLURLWithString:urlText]]];
return;
}
- (BOOL)applicationShouldTerminateAfterLastWindowClosed

returnYES;
}
@end