0
searchDisplayController에 대한 도움이 필요합니다. 지금 textDidChange, 과 함께 searchDisplayController를 사용하고 있지만 검색을 누르거나 행 중 하나에서 검색 텍스트가 searchBar에서 제거 될 때마다 그런 다음 textDidChange로 돌아가고 빈 문자열로 코드를 실행합니다. 누군가 나를 도와 드릴까요? 사전에searchDisplayController 내 검색 텍스트를 제거합니다
감사
- (void)searchBarSearchButtonClicked:(UISearchBar *)searchBar{
if(connectionStatus.boolNoConnection||connectionStatus.boolErrorConnection)
{
[self.searchDisplayController setActive:NO animated:YES];
MKCoordinateSpan span;
span.latitudeDelta = 2.5f;
span.longitudeDelta = 2.5f;
CLLocationCoordinate2D location;
location.latitude = 52.30;
location.longitude = 5.45;
MKCoordinateRegion region;
region.span = span;
region.center = location;
[map setRegion:region animated:YES];
}
else {
if (![geoArray count] == 0) {
[map removeAnnotations:pins];
[pins release];
[pinPlacemark removeAllObjects];
[self readArray:geoArray];
[self.searchDisplayController setActive:NO animated:YES];
}
}
}
난 단지 확실히 코드를 볼 필요가 있지만, 내가 읽은 내용에서 검색 텍스트를 변경할 필요가없는 곳이 여기
코드를 보는 것이 도움이됩니다. 찾아야 할 것은 UISearchView 텍스트 속성을 실제로 수정할 필요가 없다는 것입니다. 내 구현은보기 초기화시 비어 있으며 그 후에는 절대 변경하지 않습니다. 검색 버튼을 눌렀을 때 텍스트에있는 자리 표시 자 속성을 설정합니다. –