I have:
boardValue = [NSNumber numberWithInteger: 2];
NSDictionary * dict = [NSDictionary dictionaryWithValuesForKeys: @"sample", @"word", boardValue , @"value", nil];
This is very similar to the following example:
NSDictionary *dict = [NSDictionary dictionaryWithObjectsAndKeys: @"value1", @"key1", @"value2", @"key2", nil];
from Apple documentations at:
http://developer.apple.com/library/mac/#documentation/Cocoa/Reference/Foundation/Classes/nsdictionary_Class/Reference/Reference.html
I get the error “too many arguments to method call, expect 1, have 5”. What is the problem?
dictionaryWithValuesForKeys:takes an array as an argument, not a variable list of arguments.(Also, I believe it’s an instance method, not a class method, so [NSDictionary dictionaryWithValuesForKeys:args]` won’t work.)