Objective c UIWeb页面未加载
我正在尝试加载一个基本网页,但它没有加载。这有点奇怪 我有此代码(此代码无效) 但是如果我尝试Objective c UIWeb页面未加载,objective-c,xcode,ios4,uiwebview,Objective C,Xcode,Ios4,Uiwebview,我正在尝试加载一个基本网页,但它没有加载。这有点奇怪 我有此代码(此代码无效) 但是如果我尝试 [itemSummary loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://westminsteriphone.wordpress.com/2011/08/23/another-blog-post/"]]; 它起作用了这就是为什么第一个示例不加载试试这个 NSString *test = [item obj
[itemSummary loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://westminsteriphone.wordpress.com/2011/08/23/another-blog-post/"]];
它起作用了这就是为什么第一个示例不加载试试这个
NSString *test = [item objectForKey:@"link"];
NSLog(@" %@",test); // returns http://westminsteriphone.wordpress.com/2011/08/23/another-blog-post/
[itemSummary loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",text]]]];
[itemSummary loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",[item objectForKey:@"link"]]]]];
试试这个
NSString *test = [item objectForKey:@"link"];
NSLog(@" %@",test); // returns http://westminsteriphone.wordpress.com/2011/08/23/another-blog-post/
[itemSummary loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",text]]]];
[itemSummary loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:[NSString stringWithFormat:@"%@",[item objectForKey:@"link"]]]]];
如果你在不同的函数中使用这两行,那么就这样做
function 1
NSString *test = [[NSString alloc]init];
test =[NSString stringWithFormat:@"%@",[item objectForKey:@"link"]];
return [test autorelease];
function 2
[itemSummary loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:test]]];
ddi您是否尝试使用loadRequest行上的breakbpoints进行调试??如果没有,请检查测试在尝试加载请求时具有什么类型的值