2016-08-03 17 views
0

Xcode가이 특정 시나리오를 표시하지 않기 때문에 AppCode 질문 일 수 있습니다.일치하지 않는 매개 변수를 지우려면 어떻게해야합니까? nullable 및 FooType은 AppCode에서 호환되지 않는 경고입니다.

나는 AppCode 다양한 장소에서이 오류를 참조하십시오

Parameter type mismatch: Types 'nullable' and 'FooType' are not compatible 

하는 FooType 어떤 유형이 될 수있는 곳. toItem 값이 경고 태그됩니다

[self.view addConstraint:[NSLayoutConstraint constraintWithItem:spinnerBackgroundView attribute:NSLayoutAttributeLeft relatedBy:NSLayoutRelationEqual toItem:self.view attribute:NSLayoutAttributeLeft multiplier:1 constant:0]]; 

:

다음은 문제를 보여줍니다 전화입니다.

+(instancetype)constraintWithItem:(id)view1 attribute:(NSLayoutAttribute)attr1 relatedBy:(NSLayoutRelation)relation toItem:(nullable id)view2 attribute:(NSLayoutAttribute)attr2 multiplier:(CGFloat)multiplier constant:(CGFloat)c; 

이가 어떻게이 API를 호출하고있어 발생 될 수 있습니다 :

toItem 매개 변수가 널 (NULL)의 API를 보면? 또는 AppCode의 결함입니까 (차이점이없는 "게터 모드로 전환"이상의 제안 사항은 제공하지 않습니다).

답변

0

AppCode의 버그는 거의 없지만 FooType의 인터페이스 선언은 보지 않고 있습니다. 확실히 말하기 어렵다. 컴파일러가 형식 정의로 해석하는 'nullable'특성이 잘못 배치 된 것일 수 있습니다.