NSMutableData not playing ball
NSMutableData not playing ball
- Subject: NSMutableData not playing ball
- From: Nicholas Shanks <email@hidden>
- Date: Tue, 12 Feb 2002 22:16:55 +0000
- Resent-date: Wed, 13 Feb 2002 22:46:44 +0000
- Resent-from: Nicholas Shanks <email@hidden>
- Resent-message-id: <email@hidden>
- Resent-to: email@hidden (Apple Cocoa Dev)
I have a data object with some bytes in it, such as:
ABCDEFGHIJKLMNOPQRSTUVWXYZ
and I want to replace a range of characters, say { 6, 5 } with an NSString,
say @"XYZ", thus producing the output:
ABCDEXYZKLMNOPQRSTUVWXYZ
so that now the letters FGHIJ have been replaced by XYZ. My problem is
that -replaceBytesInRange:withBytes: has no idea how large the string I'm
passing in is, so just replaces five bytes with five bytes, giving XYZ and
two random bytes, whatever happened to be next in memory. I could do with
a -replaceBytesInRange:withData: method!
How am i supposed to do this?
(note I am doing the NSString -> char* thing, but left it out of the
description for simplicity)
Nicholas Shanks
--
http://nickshanks.com/
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.