Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

joak

macrumors newbie
Original poster
Mar 7, 2014
27
0
Hello

I have this array ...
Code:
{
    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"?

Regards
 

ArtOfWarfare

macrumors G3
Nov 26, 2007
9,558
6,058
Could you share the actual section of code that produces your "array" (it looks more like a dictionary to me).
 

joak

macrumors newbie
Original poster
Mar 7, 2014
27
0
I pass the value to another UIViewController so in another UIViewControler I want to get this values

Code:
 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];
 

Menneisyys2

macrumors 603
Jun 7, 2011
5,997
1,101
I pass the value to another UIViewController so in another UIViewControler I want to get this values

Code:
 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];

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.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.