Note that there are some explanatory texts on larger screens.

plurals
  1. PONSDictionary read data
    primarykey
    data
    text
    <p>I have now tried to get this to work for a few hours but just cannot get it right.</p> <p>I have the following code:</p> <pre><code>NSDictionary* dict = [NSDictionary dictionaryWithObjectsAndKeys: [NSArray arrayWithObjects:@"currentGame1", @"currentGameType1", @"currentGameQuestion1", @"currentGameRightAnswers1", @"currentGameType1", @"numberOfType0Games1", @"type0Results1", @"numberOfType1Games1", @"type1Results1",@"numberOfType2Games1", @"type2Results1",nil], @"Player1", [NSArray arrayWithObjects:@"currentGame2", @"currentGameType2", @"currentGameQuestion2", @"currentGameRightAnswers2", @"currentGameType2", @"numberOfType0Games2", @"type0Results2", @"numberOfType1Games2", @"type1Results2",@"numberOfType2Games2", @"type2Results2",nil], @"Player2", [NSArray arrayWithObjects:@"currentGame3", @"currentGameType3", @"currentGameQuestion3", @"currentGameRightAnswers3", @"currentGameType3", @"numberOfType0Games3", @"type0Results3", @"numberOfType1Games3", @"type1Results3",@"numberOfType2Games3", @"type2Results3",nil], @"Player3",nil]; [dict writeToFile:@"/Users/MikaelB/Desktop/xxxxPlayer.plist" atomically: TRUE]; NSMutableDictionary *readDict = [[NSMutableDictionary alloc] initWithContentsOfFile:@"/Users/MikaelB/Desktop/xxxxPlayer.plist"]; NSLog(@"readDict: %@", readDict); NSLog(@"= = = = = = = = = = = = = = = = = = ="); for (NSArray *key in [readDict allKeysForObject:@"Player6"]) { NSLog(@"Key: %@", key); } </code></pre> <p>The for loops is just part of the tests i do to try to extract data from the dictionary and is one of many different ways i have tested.</p> <p>My question is if there is someone nice who can show me how to extract a record (key + objects) and NSLog it?</p> <p>Cheers</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload