【发布时间】:2011-11-09 04:35:54
【问题描述】:
声明函数
- (IBAction) changeProductWeb:(NSString *)str;
- (IBAction) changeProductWeb:(NSString *)str{
NSString *urlAddress = str;
NSURLRequest *request =[NSURLRequest requestWithURL:urlAddress];
[webView loadRequest:request];
}
使用数组设置字符串
[cell changeProductWeb:[webTitle objectAtIndex:indexPath.row]];
数组
webTitle = [[NSArray alloc] initWithObjects:
@"bar.html",
@"bar.html",
@"bar.html",
@"bar.html",
nil];
当我启动它时,如果我将字符串静态设置在:
- (IBAction) changeProductWeb:(NSString *)str{
效果很好
【问题讨论】:
-
数组的范围是多少?是否保留?
标签: objective-c xcode ios4 uiwebview