Folks, 我需要關於Storyboard的幫助。 我有一個帶有表格和視圖的Storyboard,我想單擊一個單元格併爲視圖執行交易。 我將DetalheMeuPostoAmigo設置爲View並在didSelectRowAtIndexPath中將其作爲代碼進行調用。Storyboard with Xcode 4.5
當我運行應用程序時,我沒有收到任何錯誤,但事務不起作用。我使用警報測試並確定。我查閱了很多很多次的代碼...
Top10.m
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"MainStoryboard" bundle:nil];
DetalheMeuPostoAmigo *detalhesMeuPostoAmigoVC = [storyboard instantiateViewControllerWithIdentifier:@"DetalheMeuPostoAmigo"];
[self.navigationController pushViewController:detalhesMeuPostoAmigoVC animated:YES];
}
試試這個:UIStoryboard *分鏡= self.storyboard;而不是thisUIStoryboard * storyboard = [UIStoryboard storyboardWithName:@「MainStoryboard」bundle:nil]; –
Tks Rahul,我嘗試過,但沒有工作,你有另一種理想嗎? – Cauca