• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
fast enumeration puzzlement
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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

  • Follow-Ups:
    • Re: fast enumeration puzzlement
      • From: Wade Tregaskis <email@hidden>
  • Prev by Date: Re: MySQL
  • Next by Date: Re: NSTreeNode -representedObject not KVC-Compliant
  • Previous by thread: NSTreeNode representedObject not KVC-compliant?
  • Next by thread: Re: fast enumeration puzzlement
  • Index(es):
    • Date
    • Thread