我在一個新的Cocoa Touch Library中工作,我需要以編程方式顯示UIWebView,因爲我要在外部網絡中請求用戶和密碼(如oAuth),但我不知道我該如何在Cocoa Touch Library中做到這一點。在Cocoa Touch Library中顯示UIWebView
示例代碼:
Client.h
#import <Foundation/Foundation.h>
@interface Client : NSObject
@property NSString *_aProperty;
- (void)showUIWebView:(NSURL*)urlToOpen;
@end
Client.m
#import "Client.h"
@implementation Client
@synthesize _identity;
- (void)showUIWebView:(NSURL*)urlToOpen
{
// I need to write code here to show the UIWebView :)
}
@end
我喜歡這部分:'UIViewController * myVC = [self.navigationController。' 明天我會試試:) – chemitaxis 2013-03-06 19:59:05
如果你有一個'UINavigationController'並且你想要訪問的視圖是視圖層次結構中的最後一個視圖(基本上是99%的時間),它就會工作。 – 2013-03-06 23:16:54