masterViewController でテーブル セルを押すと、関連する Web ページが詳細ビュー コントローラーに読み込まれる SplitView コントロール プログラムを作成しようとしています。詳細View Controllerに次のメソッドがあり、呼び出されて正しい入力を受け取っていることを確認できます。
-(void)masterAction:(id)sender {
NSString *http = @"http://";
http = [http stringByAppendingString:sender];
_urlString = http;
NSURL *url= [NSURL URLWithString:_urlString];
[self.web loadRequest:[NSURLRequest requestWithURL:url]];
}
ただし、何もロードされていません。なぜこれが考えられるのでしょうか?何かをロードすることができた唯一の方法は、viewDidLoad メソッドに次のようなものを挿入することです。
NSURL *url= [NSURL URLWithString:@"http://www.google.com];
[self.web loadRequest:[NSURLRequest requestWithURL:url]];
メソッドは以下を使用して呼び出されています。
-(void)tableView:(UITableView *)tableView didDeselectRowAtIndexPath:(NSIndexPath *)indexPath
{
NSDictionary *thread = [self.issueData objectForKey:@"responseData"];
NSDictionary *feed = [thread objectForKey:@"feed"];
NSArray *entries = [feed objectForKey:@"entries"];
NSDictionary *posts = entries[indexPath.row];
NSString *urlString = [posts objectForKey:@"link"];
NSArray *split = [urlString componentsSeparatedByString:@"url=http://"];
NSString *url = [split objectAtIndex:1];
[self.delegate masterAction:url];
}