At first I saw many ways on the internet that were loops, okay, I also loop
Looping when creating Uisearchbar, No.
with searchbartextdidbeginediting events to cycle, also not
No words, search the first page of Baidu is a circular, looking for half an hour, finally is to find the reason
Originally in the IOS7 after the Uisearchbar cycle needs searchbar.subviews[0] Subviews
Examples are shown below:
#begin
//
Function Description: Modify the title of the Searchbar cancel Button
Note the point:
With the IOS8 SDK, this uisearchbar is for the iOS7 (+) version, and if you want to fit iOS6, you need to match iOS6.
For example:
ios7+: for (id cc in [searchbar.subviews[0] subviews]) {}
Ios7-: for (id cc in [searchbar subviews]) {}
//
#end
I'm drunk, too. This makes the novice how to be good ah. Fortunately, finally came true. Tangled Half Day
Modify the Searchbar Cancel button to cancel to Chinese