• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Deleting data from NSMutableData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Deleting data from NSMutableData


  • Subject: Re: Deleting data from NSMutableData
  • From: "Adam R. Maxwell" <email@hidden>
  • Date: Tue, 20 Mar 2007 22:33:55 -0700


On Mar 20, 2007, at 22:25, Andy Lee wrote:

On Mar 21, 2007, at 12:04 AM, R. Tyler Ballance wrote:
I had thought about seeing what I could crash with using replaceBytesInRange:withBytes:length: and passing it a NULL, but that seems hackish and unstable at best.

I was going to suggest a combination of -mutableBytes, strncpy(), and -setLength, but this method sounds like exactly what you need. I haven't tested all boundary cases, but it seems to work. I don't see any reason not to use it.

Since NSMutableData is toll-free bridged with CFMutableData, why not use CFDataDeleteBytes()? That should always do the right thing.


-- Adam
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: Deleting data from NSMutableData
      • From: Jim Correia <email@hidden>
References: 
 >Deleting data from NSMutableData (From: "R. Tyler Ballance" <email@hidden>)
 >Re: Deleting data from NSMutableData (From: Jim Correia <email@hidden>)
 >Re: Deleting data from NSMutableData (From: "R. Tyler Ballance" <email@hidden>)
 >Re: Deleting data from NSMutableData (From: Andy Lee <email@hidden>)

  • Prev by Date: Re: Deleting data from NSMutableData
  • Next by Date: Re: NSData dataWithBytes problem on Intel
  • Previous by thread: Re: Deleting data from NSMutableData
  • Next by thread: Re: Deleting data from NSMutableData
  • Index(es):
    • Date
    • Thread