Web サービスから n 個の URL を取得します。didSelectRowAtIndexPath を選択すると、その特定のファイルの URL を表示する必要があります。すべての行の URL が異なることに注意してください。URLをSaveDisplayクラスに保存し、SaveDisplay.mクラスには次のコードがあります
「SaveDisplay.h」をインポートします
@implementation SaveDisplay
@synthesize buttonName;
@synthesize urlForLoad;
- (id) initWithButtonName:(NSString *)_buttonName withUrlForLoad:(NSString *)_urlForLoad
{
self = [super init];
if(self)
{
self -> buttonName = _buttonName;
self -> urlForLoad = _urlForLoad;
}
return self;
}
@end
これが私が試みていることですが、それをループしてそれぞれのファイルのURLを設定する適切な方法が必要です
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SaveDisplay *objectForUrl = [[SaveDisplay alloc] init];
WebViewController *webController = [[WebViewController alloc] initWithNibName:@"WebViewController" bundle:Nil];
webController.urlToLoad = objectForUrl.urlForLoad;
[self.navigationController pushViewController:webController animated:YES];
}