Advertisement
Guest User

Untitled

a guest
Apr 25th, 2013
113
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2. -(void) viewWillAppear:(BOOL)animated {
  3.     AppDelegate *appDelegate = (AppDelegate *) [[UIApplication sharedApplication]delegate];
  4.     searchBarVisivel = NO;
  5.     pareAquiClicado = NO;
  6.     ondeParei = NO;
  7.     busca = NO;
  8.     posicao = 0;
  9.     contador = 0;
  10.     tbEstacionamentos.delegate = self;
  11.    
  12.     _listaEstacionamentos = [[NSMutableArray alloc]init];
  13. }
  14.  
  15.  
  16.  
  17.  (void)viewDidLoad //só passa por aqui quando for a primeira vez que esta tela aparece.
  18. {
  19.     [viewLoading setBackgroundColor:[UIColor colorWithRed:53.0/255.0 green:100.0/255.0 blue:162.0/255.0 alpha:1]];
  20.     filtro = @"Distância";
  21.     self.view.frame = [[UIScreen mainScreen] applicationFrame];
  22.     [super viewDidLoad];
  23.     tbSugerir.delegate = self;
  24.     listaSugerir = [[NSMutableArray alloc]init];
  25.    
  26.     // Do any additional setup after loading the view.
  27. }
  28.  
  29.  
  30. - (void)searchBarSearchButtonClicked:(UISearchBar *)aSearchBar {
  31.     [NSThread detachNewThreadSelector:@selector(workerThread) toTarget:self withObject:nil];
  32.     // When the search button is tapped, add the search term to recents and conduct the search.
  33.     NSString *searchString = [searchBar text];
  34.     [searchBar resignFirstResponder];
  35.     [self search:searchString];
  36. }
  37.  
  38. -(IBAction)btnSearchClick:(id)sender {
  39.     if (!searchBarVisivel) {
  40.         [self inserirTap];
  41.         [searchBar setHidden:NO];
  42.         searchBarVisivel = YES;
  43.         [self.view bringSubviewToFront:searchBar];
  44.     }
  45.     else
  46.     {
  47.         [self removerTap];
  48.         searchBar.text = @"";
  49.         searchBarVisivel = NO;
  50.         [searchBar setHidden:YES];
  51.         [searchBar resignFirstResponder];
  52.     }
  53. }
  54.  
  55. -(BOOL) searchBar:(UISearchBar *)searchBar shouldChangeTextInRange:(NSRange)range replacementText:(NSString *)text  {
  56.     return YES;
  57. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement