Pass two string to Detail View from Search Array

Posted by waqqas on Stack Overflow See other posts from Stack Overflow or by waqqas
Published on 2011-06-30T14:51:46Z Indexed on 2011/06/30 16:22 UTC
Read the original article Hit count: 129

Filed under:

I am using a tableview with a search function and is populated by a plist. I want to pass 2 strings through to a DetailView. But I can only get the sting used to populate the cell to pass over. I have tried many variations but can't figure it out. Any help would be greatly appreciated.

    DetailView *nextLevel = [DetailView alloc];
NSString *valueString;
    NSString *selectedTitle;
if (arraySearch == nil) {
    NSString *key = [arrayDataKeys objectAtIndex:indexPath.section];
    NSArray *nameSection = [dictAllData objectForKey:key];
    NSDictionary *dict = [nameSection objectAtIndex:indexPath.row];
    valueString = [dict objectForKey:@"name"];
    selectedTitle = [dict objectForKey:@"word"];

} else {
    valueString = [arraySearch objectAtIndex:indexPath.row];
    **selectedTitle = [arraySearch objectAtIndex:indexPath.row];** //Obviously this is wrong but this is the line I need help with

}

nextLevel.title = valueString;
nextLevel.itemname = valueString;
nextLevel.itemWord = selectedTitle;

© Stack Overflow or respective owner

Related posts about uisearchbar