¡@

Home 

2014/10/15 ¤U¤È 10:14:11

iphone Programming Glossary: shouldbeginediting

UISearchbar clearButton forces the keyboard to appear

http://stackoverflow.com/questions/1092246/uisearchbar-clearbutton-forces-the-keyboard-to-appear

track of that we need to declare a BOOL ivar in our viewController that is also the searchBar delegate let's call it shouldBeginEditing and set it with an initial value of YES supposing our viewController class is called SearchViewController @interface SearchViewController.. @interface SearchViewController UIViewController UISearchBarDelegate all of our ivar declarations go here... BOOL shouldBeginEditing .... ... @end @implementation SearchViewController ... id initWithNibName NSString nibNameOrNil bundle NSBundle nibBundleOrNil.. nibNameOrNil bundle NSBundle nibBundleOrNil if self super initWithNibName nibNameOrNil bundle nibBundleOrNil ... shouldBeginEditing YES ... @end Later on in the UISearchBarDelegate we implement the searchBar textDidChange and searchBarShouldBeginEditing..