Question

    for (int x = 0; x < openSlots; x++) {
    NSLog(@"Loading slot %i.", (x+1)); 
    [[valueEditorSlots objectAtIndex:x] setStringValue:[[valueSavesDictionary valueForKey:[NSString stringWithFormat:@"Value Slot %i", (x+1)]] stringValue]];
    [[valueSlots objectAtIndex:x] setStringValue:[[valueSavesDictionary valueForKey:[NSString stringWithFormat:@"Value Slot %i", (x+1)]] stringValue]];        
    [[slotValues objectAtIndex:x] setIntValue:[[valueSavesDictionary valueForKey:[NSString stringWithFormat:@"Slot Value %i", (x+1)]] intValue]];
}

Hello, I'm trying to read a set of strings and numbers from a property list. An NSNMutableArray is holding all the variable names (indexed 0-8). So I run through each member of the array (all of which are UI textfields) and set the string value to its corresponding property list key (Value Slot #). This doesn't work. I receive the following error message in the debugger:

-[__NSCFString stringValue]: unrecognized selector sent to instance 0x100463110

Thank you

Was it helpful?

Solution

Your're calling stringValue on an NSString on lines 3 and 4. They are already strings so this is unnecessary.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top