FROM : Kyle Sluder
DATE : Sat Jun 28 22:03:53 2008
On Sat, Jun 28, 2008 at 3:56 PM, Markus Spoettl
<<email_removed>> wrote:
> I had this in my code
>
> - (void)remove<key>AtIndexes:(NSIndexSet *)indexes
> {
> NSMutableArray *kva = [self mutableArrayValueForKey:@"<key>"];
> [kva removeObjectsAtIndexes:indexes];
> }
And you're surprised that this caused an infinite loop? The point of
the indexed accessors is to implement the actual data manipulation for
the proxy returned by -mutableArrayValueForKey. So all
-removeKeyAtIndexes: should do is remove the requested object from
whatever storage mechanism is being used to back that property.
--Kyle Sluder
DATE : Sat Jun 28 22:03:53 2008
On Sat, Jun 28, 2008 at 3:56 PM, Markus Spoettl
<<email_removed>> wrote:
> I had this in my code
>
> - (void)remove<key>AtIndexes:(NSIndexSet *)indexes
> {
> NSMutableArray *kva = [self mutableArrayValueForKey:@"<key>"];
> [kva removeObjectsAtIndexes:indexes];
> }
And you're surprised that this caused an infinite loop? The point of
the indexed accessors is to implement the actual data manipulation for
the proxy returned by -mutableArrayValueForKey. So all
-removeKeyAtIndexes: should do is remove the requested object from
whatever storage mechanism is being used to back that property.
--Kyle Sluder
| Related mails | Author | Date |
|---|---|---|
| Markus Spoettl | Jun 28, 21:56 | |
| Kyle Sluder | Jun 28, 22:03 | |
| Markus Spoettl | Jun 29, 00:53 | |
| Keary Suska | Jun 29, 01:02 | |
| Clark Cox | Jun 29, 01:06 | |
| Markus Spoettl | Jun 29, 01:38 | |
| Quincey Morris | Jun 29, 02:07 | |
| Markus Spoettl | Jun 29, 02:36 |






Cocoa mail archive

