问题描述 我在深圳图书馆进行测试,这里有名为“reader”无密码无线网 可以正常连接,但不能直接上网的。 我现在火狐、ie safari 都能正确弹出那个问是否继续的证书显示框,但我用UIWebView 上网时 网页一直在加载中。。。 UIWebView 要怎么配置或操作才能跟正常的浏览器一样程现那个“登录”验证过程呀? |
|
50分 |
- (void)webView:(id)fp8 resource:(id)fp12 didReceiveAuthenticationChallenge:(id)fp16 fromDataSource:(id)fp20; - (void)webView:(UIWebView *)webView resource:(NSObject *)resource didReceiveAuthenticationChallenge:(NSURLAuthenticationChallenge *)challenge fromDataSource:(WebDataSource *)dataSource; - (void)webView:(id)webView resource:(id)resource didReceiveAuthenticationChallenge:(id)challenge fromDataSource:(id)dataSource { NSURLCredential *credential = [NSURLCredential credentialWithUser:@"user" password:@"password" persistence:NSURLCredentialPersistenceForSession]; [[challenge sender] useCredential:credential forAuthenticationChallenge:challenge]; } |
+ (void) addAuthToWebRequest:(NSMutableURLRequest*)requestObj email:(NSString*)email password:(NSString*)password{ NSString *authString = [[[NSString stringWithFormat:@"%@:%@", email, password] dataUsingEncoding:NSUTF8StringEncoding] base64Encoding]; authString = [NSString stringWithFormat: @"Basic %@", authString]; [requestObj setValue:authString forHTTPHeaderField:@"Authorization"]; } NSURL *url = [NSURL URLWithString:urlAddress]; NSMutableURLRequest *requestObj = [NSMutableURLRequest requestWithURL:url]; [Utility addAuthToWebRequest:requestObj email:[Account getCurrentAccount].email password:[Account getCurrentAccount].password]; |
|
这是哪个版本的api呀。。3.1.2支不支持呀?
|
|
#import <Foundation/Foundation.h>
#import <UIKit/UIView.h> #import <UIKit/UIKitDefines.h> #import <UIKit/UIDataDetectors.h> enum { @class UIWebViewInternal; UIKIT_EXTERN_CLASS @interface UIWebView : UIView <NSCoding> { @property(nonatomic,assign) id<UIWebViewDelegate> delegate; – (void)loadRequest:(NSURLRequest *)request; @property(nonatomic,readonly,retain) NSURLRequest *request; – (void)reload; – (void)goBack; @property(nonatomic,readonly,getter=canGoBack) BOOL canGoBack; – (NSString *)stringByEvaluatingJavaScriptFromString:(NSString *)script; @property(nonatomic) BOOL scalesPageToFit; @property(nonatomic) BOOL detectsPhoneNumbers __OSX_AVAILABLE_BUT_DEPRECATED(__MAC_NA, __MAC_NA, __IPHONE_2_0, __IPHONE_3_0); @end @protocol UIWebViewDelegate <NSObject> @optional @end 这个是我在3.1.2sdk中找到的api |
|
3.1.2?
怎么不升级4.0或3.2…… |
|
呵呵。。我是NX6325的黑户 刚好能装10.5.7(3.1.2) 尝试黑户10.6 好像是显卡驱动不行。。
|
|
哈哈 我黑户成功了..10.6.3 NX6325也能安装上 太帅了.
|