나는 comparer selector를 사용하고있는 NSMutableArray를 정렬하려고합니다.NSMutableArray를 어떻게 정렬합니까?
- (NSComparisonResult)compare:(Product *)someObject {
return [self.Price compare:someObject.Price];
}
HomeProducts = [HomeProducts sortedArrayUsingSelector:@selector(compare:)];
같은 배열을 정렬하고 다른 배열에 할당하지 않으려합니다.
request for member 'Price' in something not a structure or union ....
자아를 인식하지 못합니다.
NSMutableArray에 어떤 객체를 저장합니까? PLZ가 동일한 코드를 제공 할 수 있습니까? –
이 이 하나를 시도 http://stackoverflow.com/questions/805547/how-to-sort-an-nsmutablearray-with-custom-objects-in-it ... – shivangi
에 http : // 유래 .COM/질문/805547/방법 - 투 - 정렬 AN-있는 NSMutableArray -와 - 사용자 정의 개체 -에 - 그것은 이 링크는 당신을하는 데 도움이 될 수있다 참조 ... – shivangi