Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8560335
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T16:15:11+00:00 2026-06-11T16:15:11+00:00

I use NSMutableData objects to store lists of 32 byte structs that represent series

  • 0

I use NSMutableData objects to store lists of 32 byte structs that represent series data. These series are potentially extended, added, aligned, etc. To save allocation of unnecessary objects I try to extend and append bytes to existing objects rather than allocate new ones.

I noticed some strange behavior in the simulator today: 1) using setLength and increaseByLength didn’t always zero all new bytes and 2) use of these objects after modification resulted in crashes. The crashes were all in very different areas but always EXC_BAD_ACCESS. After quite a bit of debugging I ended up allocating new objects for working with via mutableCopy and assigning them to my object attributes when done. That solved all of the issues I was having.

* I am working with these objects in background threads but have wrapped all operations in a synchronized block and have not been able to observe any race conditions on the objects in question.

Has anyone noticed similar oddities?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T16:15:13+00:00Added an answer on June 11, 2026 at 4:15 pm

    I haven’t received an answer for this so I thought I’d follow up with my solution. I ended up reallocating new NSData / NSMutableData objects as I need them and working with the memory directly before wrapping it in NSData objects.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I get image data from NSURLConnection , and store the data using NSMutableData .
I have this code that im trying to use to capture audio data. However
I'm trying to save the objects called blobs using NSKeyedArchiver. I use NSMutableData and
use strict; use warnings; use Data::Dumper; my %h; my $undef = undef; $h{''}='test2'; $h{$undef}
use LWP::UserAgent; use Data::Dumper; my $ua = new LWP::UserAgent; $ua->agent(AgentName/0.1 . $ua->agent); my $req
I try to decrypt data that was originally encrypted with Objective-C in Java. There
I use plist to save data as shown below. I need now to delete
This is the code that i use for upload the video to web server
Use Case I'm using sockets to send and receive data using CFStreamCreatePairWithSocketToHost() and am
Can't see why this is happening, but when I use Bluetooth to send data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.