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

  • Home
  • SEARCH
  • 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 9272513
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T15:53:35+00:00 2026-06-18T15:53:35+00:00

I have an allocated object where its attributes are store in the following memory

  • 0

I have an allocated object where its attributes are store in the following memory places:
Memory status

When I make a simple attribution of the NSDate attribute to a variable it gives me an EXEC_BAD_ACESS.
As you can see from the first image only the date attribute and the fileDate variable have different addresses.

EXEC_BAD_ACESS

Am I making some pointer related error?
The other 2 attributes are assigned correctly to the variables, it only happens with the NSDate so maybe I’m missing some detail about NSDate.

EDIT1

DownloadFile definition:
DownloadFile

EDIT2

init function:
enter image description here

EDIT3
date parameter:

date

  • 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-18T15:53:36+00:00Added an answer on June 18, 2026 at 3:53 pm

    Is there any reason why you are not using ARC? There are quite a few memory management errors there causing leaks and one that should cause your crash.

    NSDate *dateFromString = [dateFormatter dateFromString:receivedDate];
    

    returns an autoreleased NSDate so when you then call the additional

    [dateFromString autorelease];
    

    you are overreleasing the NSDate hence your crash.


    [pFile setDate:[[NSDate alloc] init]];
    

    is a memory leak. Going through the setter setDate: will cause pFile to take a +1 retain on the date, which it should release in it’s dealloc. The [[NSDate alloc] init] call returns a date object with +1 but is then never released elsewhere.

    You can fix this either with

    [NSDate date]
    

    Or

    [[[NSDate alloc] init] autorelease];
    

    The first option is preferred

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

Sidebar

Related Questions

I have allocated a chunk of memory of type char and size is say
In my freeglut project, i have allocated alot of memory, and i have no
Say I have an instance variable MyObject that has been allocated and initialized. Then
If I have an autoreleased object, when does its retain count (i.e. the value
I have an windowless IViewObject object. I want to call its Draw function to
I have a simple method in my model to create a NSDictionary object containing
I have a problem with IplImage* returned from cvQueryFrame ... Its memory is never
I have an int array for which i have allocated space for 100 elements.
Let's say I have a pointer allocated to hold 4096 bytes. How would one
I have a MKAnnotationView being allocated with a DetailDisclosure button being displayed on the

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.