Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

thomasjt

macrumors newbie
Original poster
Hi,

I was having some problems with initialising an NSMutableDictionary so I turned to the documentation. There, I found this example:

Code:
NSDictionary *dict = [[NSDictionary alloc] initWithObjectsAndKeys:@"value1", @"key1", @"value2", @"key2", nil];

which I then tried to compile. I got the following error - the same one as the error I was getting for my code:

error: initalizor element is not constant

Any ideas what's going on?

Cheers,

Tom
 
Where are you calling this code? If it's outside of a method in your @implementation block, you'll get this error.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.