ターゲットをセレクターに設定する方法を知りたいです。この電話をかけたい >>
sortedArray = [views sortedArrayUsingSelector:@selector(compareWithUnit:)];
問題は、私のcompareWithUnit機能がLogUnitクラスにあることです。LogUnitclassでセレクターを探すようにコンパイラーに指示するにはどうすればよいですか?
views配列には (UIViewControllers) オブジェクトのみが含まれており、配列を結果LogUnitで並べ替えたいと考えています。views[LogUnit dayTime]
- (NSComparisonResult) compareWithUnit:(LogUnit*) unit;
{
return [[self dayTime] compare:[unit dayTime]];
}