Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Linking the results to another ViewController #1

Open
adage2014 opened this issue Jun 26, 2014 · 1 comment
Open

Linking the results to another ViewController #1

adage2014 opened this issue Jun 26, 2014 · 1 comment

Comments

@adage2014
Copy link

Really great work by the way. I was hoping you could help me with a quick question that has been troubling me for weeks. I basically need a text search control of a NSArray list, (like SearchHUD). The issue I'm having is trying to get a result that has been filtered to go to a specific View Controller, either via a segue or Xib file. For example, in your SearchHUB, the user types in "f", then "France" appears. I would then like to have when the user then clicks "France" from the filtered list, to go to my already created FranceViewController. If they searched "Germany", once clicked it would go to the GermanyViewController I created. You now have it currently setup so when the user clicks "France", it goes back to the main ViewController and loads the data of "France" into the label of that view.

Please let me know if that makes sense, any help is greatly appreciated! I have spent much time trying to figure this out.

Thanks!

Michael

@pradyumnad
Copy link
Owner

The below delegates will be helpful to do any decisions.

#pragma mark -
#pragma mark SearchHUD

- (void)didSelectRowAtIndex:(NSUInteger)index {
    NSLog(@"Index of Tapped item : %lu", (unsigned long) index);
    _countryLabel.text = (self.items)[index];
}

- (void)didSelectItem:(NSString *)item {
    NSLog(@"Selected Item %@", item);
    _countryLabel.text = item;
}

In - (void)didSelectRowAtIndex:(NSUInteger)index; method just write a switch case and present the controller you wanted to show for the selected index/item

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants