Create NSStrings from a mapped NSData object - safe?
Create NSStrings from a mapped NSData object - safe?
- Subject: Create NSStrings from a mapped NSData object - safe?
- From: Daniel Vollmer <email@hidden>
- Date: Tue, 13 May 2008 08:38:46 +0200
Salutations!
I'm parsing a rather large text-file (usually >20MB) and in doing so
I'm iterating over its lines with [String getParagraphStart::::]. I've
found a rather noticeable speed-up in the parsing operation if I
create the string in question from an NSData object (created via
initWithContentsOfMappedFile) using [String initWithData:encoding:].
Now to the questions:
1) Is this safe if the file in question is being moved / deleted /
edited during parsing?
2) Are substrings created from the original string (e.g.
substringWithRange etc.) still backed properly after the original
string and the NSData object are released?
Thanks for any pointers,
Daniel.
_______________________________________________
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