Re: Fast Enumeration and remove elements

2015-01-18 Thread Quincey Morris
On Jan 18, 2015, at 12:45 , Trygve Inda wrote: > > NSMutableDictionary* collection; // keys are myID, values are MyObject > > for (MyObject* object in [[self collection] allValues]) > { >[collection removeObjectForKey:[object myID]]; > } What Ken said, plus … — If the collection of values

Re: Fast Enumeration and remove elements

2015-01-18 Thread Ken Thomases
On Jan 18, 2015, at 2:45 PM, Trygve Inda wrote: > So is this safe... > > NSMutableDictionary* collection; // keys are myID, values are MyObject > > for (MyObject* object in [[self collection] allValues]) > { >[collection removeObjectForKey:[object myID]]; > } > > It would seem that this i