fast enumeration puzzlement
fast enumeration puzzlement
- Subject: fast enumeration puzzlement
- From: "James Stein" <email@hidden>
- Date: Mon, 24 Dec 2007 00:11:25 -0800
Here's a dead simple program:
int main(int argc, char *argv[]) {
NSMutableDictionary * D = [NSMutableDictionary dictionaryWithCapacity:
5 ];
for (id key in D) { }
return 0;
}
Obviously, it won't do much, but here's the puzzle:
I have the above main program in two projects, both open at the same time.
One compiles and links OK;
the other gives two compiler warnings:
* warning: Mac OS X version 10.5 or later is needed for use of
foreach-collection-statement*
* warning: 'NSMutableDictionary' may not respond to
'-countByEnumeratingWithState:objects:count:'*
and a link error:
* Undefined symbols:*
* "_objc_enumerationMutation", referenced from: *
* _main in main.o*
The project that works was recently created by making a new Project,
a Cocoa application, and replacing the function 'main', nothing else.
The other is a program I've been working on since pre-Leopard.
I've compared the project settings for the two projects, but see no relevant
differences.
Any ideas, any one?
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden