| |||
| [Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] |
Nicko van Someren wrote:...
If you make immutable copies of immutable NSString, NSDate, NSArray or NSDictionary objects (to pick a few important examples) you simply get the same object with the reference count incremented. This saves some data copying for simple objects and by the time you get to complex objects like dictionaries the cost of copying can get pretty high.
A question I've had is when a container is said to be immutable, is it still fair game to change the contents of the objects that are contained?
For example: An NSArray containing NSMutableString objects, or an NSData object. Can you / Should you change the contents of the NSMutableStrings in the NSArray or the Memory block pointed to by the NSData?
Should items contained in immultable container classes be considered immutable?
| References: | |
| >Copy and release (From: Nicko van Someren <email@hidden>) | |
| >Re: Copy and release (From: Evan Schoenberg <email@hidden>) | |
| >Re: Copy and release (From: Nicko van Someren <email@hidden>) | |
| >Re: Copy and release (From: Paul Sargent <email@hidden>) |
| Home | Archives | FAQ | Terms/Conditions | Contact | RSS | Lists | About |
Visit the Apple Store online or at retail locations.
1-800-MY-APPLE
Contact Apple | Terms of Use | Privacy Policy
Copyright © 2007 Apple Inc. All rights reserved.