How can i getting a value?

Discussion in 'iOS Programming' started by joak, Apr 1, 2014.

  1. joak macrumors newbie

    Mar 7, 2014

    I have this array ...
        equipos = "Sportin VS Portugal";
        "hora_partido" = "11:00";
        "id_equipoL" = 12;
        "id_equipoV" = 5;
        "id_jornada" = 11;
        "id_juego" = 3;
        "id_torneo" = 10;
        "nom_torneo" = "Juvenil Sabatino";
    How can I get the values por the key "EQUIPOS"?

  2. ArtOfWarfare macrumors G3


    Nov 26, 2007
    Could you share the actual section of code that produces your "array" (it looks more like a dictionary to me).
  3. joak thread starter macrumors newbie

    Mar 7, 2014
    I pass the value to another UIViewController so in another UIViewControler I want to get this values

     NSString *selectedCell = nil;
        NSDictionary *dictionary = [self.dataArray objectAtIndex:indexPath.section];
        NSArray *array = [dictionary objectForKey:@"data"];
        selectedCell = [array objectAtIndex:indexPath.row];
        NSLog(@"%@", [array objectAtIndex:indexPath.row]);
        JFGTablero *tablero = [self.storyboard instantiateViewControllerWithIdentifier:@"JFGTablero"];
        tablero.datosEncuentro =[array objectAtIndex:indexPath.row];
        [self.navigationController pushViewController:tablero animated:YES];
  4. Menneisyys2 macrumors 603

    Jun 7, 2011
    Just add a NSDictionary property to the pushed VC and set its value to your NSDictionary before the call to pushViewController. Then, you'll be able to access the dictionary during the entire lifetime (incl. viewDidLoad() etc.) of your sub-VC.

    If you don't know how this is done, please change the class/prop names to English so that I can have an easier time working with them and I'll answer with a full Xcode project showing this.
  5. joak thread starter macrumors newbie

    Mar 7, 2014

Share This Page