2012-11-07 8 views
0

이 바보 같은 질문,하지만 내 자 NSPredicate의 모든 지금까지 그들에게 주어진 키의 일종 가지고 있습니다iPhone NSPredicate 속성에 값이 있는지 확인하는 조건자를 만드는 방법은 무엇입니까?

@"SELF.typeRelationship.categoryType != %d"; 

가 지금은 핵심 데이터에서 모든 개체를 끌어 것 술어를 만들 필요를 그 그들에게 할당 된 가치가있다. 어떤 가치가있을 것입니다.

@"SELF.typeRelationship.categoryType != 0"; 
@"SELF.typeRelationship.categoryType != nil";//if an object property? 

, 또는 내가 속성이 객체가 할당되었는지 확인하는 데 사용해야 더 좋은 형식이 :

내 술어는 모습 것인가? categoryType이 문자열 인 경우

답변

0

,이 작업을 수행

NSPredicate *predicateName = [NSPredicate predicateWithFormat:@"SELF.typeRelationship.categoryType.length > 0"]; 
관련 문제