Assuming the stored value is NSNumber, you can use doubleValueas follows:
tempBrain.operand = [[variables objectForKey:[(NSString*)obj stringByReplacingOccurencesOfString:VARIABLE_PREFIX withString:@""]] doubleValue];
Notice that I changed valueForKeyto objectForKey, which is the correct method to get the object from NSDictionary.