UITextField * textField= self.textField;
textField.background = [UIImage resizeableImageWithCapInsets2:UIEdgeInsetsMake(0, 7, 0, 7) withName:@"Search-Field"];
간단한 코드.7.1에서이 코드가 더 이상 작동하지 않는 이유는 무엇입니까?
2014-03-13 09:31:02.099 isikota[179:60b] -[BGSearchBar setBackground:]: unrecognized selector sent to instance 0x17566b20
2014-03-13 09:32:17.720 isikota[179:60b] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[BGSearchBar setBackground:]: unrecognized selector sent to instance 0x17566b20'
이치에 맞지 않습니다.
-(UITextField *) textField
{
UIView * textFieldView = [self findASubViewWithProtocol:@protocol(UITextInputTraits)];
return (UITextField *)textFieldView;
}
이 더 이상 UISearchBar에서 TextField를 얻을 수있는 방법이 될 것 같다 : 분명히 배경은 문제가 I이 사용하는 것을 나는 발견에 textField
의 속성입니다. 어떻게 그럴 수 있니?
나는 문제가
return (UITextField *)textFieldView;
이 런타임 오류를 반환하지 않습니다 왜 지금 textFieldView 더 이상 UITextField에
의 서브 클래스
오류 메시지는'textField'는'BGSearchBar'입니다. – Pang
알아. 보이는 7.1 UIView * textFieldView = [self findASubViewWithProtocol : @protocol (UITextInputTraits)]; uisearchbar를 반환하십시오. –