Question

Why doesn't testVariableValues have the method dictionaryWithObjectsAndKeys?

@property (nonatomic, strong) NSDictionary *testVariableValues;

I'm trying to use the method like so:

[self.testVariableValues dictionaryWithObjectsAndKeys:......]

The only method available is [self.testVariableValues dictionaryWithValuesForKeys...

I'm new to Objective C and don't have much of an idea about the problem. Something to do with instance methods?

Was it helpful?

Solution

You're mixing up class methods and instance methods.

You need to call

 self.testVariableValues = [NSDictionary dictionaryWithObjectsAndKeys:obj1, @"key1"..., nil].

Hope that helps.

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