我想使用AFNetworking將網頁加載到我的UIWebView。我已經將AFNetworking庫導入到我的項目中並用於加載圖像。 我想要一個代碼來加載網頁。您的幫助。謝謝!如何使用AFNetworking在ios中加載網頁到UIWebView
這是我如何加載images.it工作正常。
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
HomeTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"homereuseIdentifier"];
Home *mogoHome = [homepost objectAtIndex:indexPath.row];
NSString *homeimageurlname = [NSString stringWithFormat:@"%@", mogoHome.homeImage];
NSURL *homeimageurl = [NSURL URLWithString:homeimageurlname];
cell.hometitleLabel.text = mogoHome.homeTitle;
[cell.homeimageView setImageWithURL:homeimageurl placeholderImage:nil];
cell.timeLabel.text = [[mogoHome.modifiedTime componentsSeparatedByString:@" "] objectAtIndex:1];
return cell;
}
但我用正常的方式來至於我能理解你不能加載網頁
NSString *finalString = [NSString stringWithFormat:@"%@", self.home.homewebUrl];
NSURL *finalurl = [NSURL URLWithString:finalString];
NSURLRequest *finalReques = [NSURLRequest requestWithURL:finalurl];
[self.finalwebView loadRequest:finalReques];
@ anuk--如果你顯示你的代碼很容易就可以解決問題 –
你的意思是你想讓AF下載html並在UIWebView中顯示而不是在UIWebView中加載html? –
是@Toni李我想加載使用AF –