「ボタン」というボタンを使っています。それをクリックすると、 PopOverControllerの助けを借りて、TableViewのkkkk配列に存在する内容を表示したいです。つまり、セルに kkkk 配列の内容を表示する小さな tableView をポップアップさせたいとします。
次のコード行を使用しています::
table = [[UITableViewController alloc]init];
popover2 = [[UIPopoverController alloc] initWithContentViewController:table];//Tell which view controller should be shown
[popover2 setPopoverContentSize:CGSizeMake(200, 200)]; // set content size of popover
[popover2 presentPopoverFromBarButtonItem:uploadspace permittedArrowDirections:UIPopoverArrowDirectionAny animated:YES]; //From where it should "pop"
self.popoverController = popover2;
popoverController.delegate = self;
NSString *hhDir = [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"];
NSString *hhFilePath = [hisDir stringByAppendingPathComponent:@"hh.txt"];
NSArray *array = [NSArray arrayWithContentsOfFile:hhFilePath ];
kkkk = [[NSMutableArray alloc] init];
for (NSDictionary *dict in array) {
[keys addObjectsFromArray:[dict allkkkk]];
// NSLog(@"%@ hellooooooooo", [kkkk objectAtIndex:0]);
}
NSLog(@"hiiiiiii");
NSLog(@"%@", [kkkk objectAtIndex:0]);
table.tableView.delegate=self;
table.tableView.delegate = self;
table.tableView = [[UITableView alloc] initWithFrame:[window bounds]];
// Set up the image view and add it to the view but make it hidden
[window addSubview:table.tableView];
//table.hidden = YES;
[window makeKeyAndVisible];
[self.table.tableView reloadData];
ここで、tView はUITableViewで、テーブルはUITableViewControllerです。
「ボタン」を押すと、TableView がポップアップ表示されます。ただし、kkkk 配列の値を入力することはできません。TableView にデータを入力する方法について、Google でよく検索しました。 、しかし、PopOverController を使用して TableView を表示するのは違うと思います。
誰かがそれを整理するのを手伝ってくれますか? ありがとうございます。