をロードすることはありません、他のビューコントローラからプッシュされ、私はストーリーボードで作成しUITableView
でビューコントローラを持っています。テーブル内の画像の1つをスワイプすると、現在のView Controller(SecondViewController
)がxibファイル(SpeciesViewController.xib
)をロードして「アプリケーションを利用する」ようにして新しいビューにしたいと思います。今のところ、didSelectRowAtIndexPath
がスワイプで呼び出されますが、xibファイルは決してロードされません。ビューコントローラが私のタブベースのアプリケーションで
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
SpeciesViewController* speciesController = [[[SpeciesViewController alloc]initWithNibName:@"SpeciesViewController" bundle:nil] autorelease];
// SpeciesViewController* speciesController = [[SpeciesViewController alloc] init];
Species *theSpecies = [fetchedResultsController objectAtIndexPath:indexPath];
speciesController.theSpecies = theSpecies;
switch (sortBySegmentedControl.selectedSegmentIndex) {
case kSortByCommonNameFirst:
speciesController.title = [theSpecies commonNameFirstLast];
break;
case kSortByCommonNameLast:
speciesController.title = [theSpecies commonNameLastFirst];
break;
case kSortByScientificName:
speciesController.title = [[NSString alloc] initWithFormat:@"%@%@",
[theSpecies.scientificName substringToIndex:1],
[[theSpecies.scientificName substringFromIndex:1] lowercaseString]];
break;
default:
break;
}
speciesController.hidesBottomBarWhenPushed = YES;
self.navigationItem.backBarButtonItem = [[UIBarButtonItem alloc] initWithTitle:@"Back" style:UIBarButtonItemStylePlain target:nil action:nil];
//// Store current index path for viewDidAppear animation. ////
self->currentSelectedIndexPath = indexPath;
[self.navigationController pushViewController:speciesController animated:YES];
}
SpeciesViewController
ペン先は、属性インスペクタでそのカスタムクラスとしてSpeciesViewController
を持っています。この理由から、pushViewController:speciesController
のときに、ViewDidLoad、またはその他の方法がSpeciesViewController.m
から呼び出されると思います。
ペン先の取り付けに関する問題の多くは、initWithNibName
とinitWithCoder
の間違いと関連しています。しかし、私は正しくビューコントローラからそうしているので、initWithNibName
を正しく使用していると思います。
ご協力いただきありがとうございます。どうもありがとうございます!
を役に立てば幸い? – Matt
@Mattはいあなたが表示コントローラを提示することができます、私の更新された答えを確認してください、顔の問題があれば、 – 3stud1ant3
presentViewControllerが働いてください - ありがとう! – Matt