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 516995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T07:47:19+00:00 2026-05-13T07:47:19+00:00

I have problem with this code, it’s working on debug environment. On the instruments

  • 0

I have problem with this code, it’s working on debug environment. On the instruments I’m seeing memory leak problem on this function, instruments is giving warning that

Category Event Type Timestamp Address Size Responsible Library Responsible Caller
27 SocialNetwork Malloc 00:19.951 0x3d64d20 80 Foundation -[NSKeyedUnarchiver _decodeArrayOfObjectsForKey:]

- (NSMutableArray *)GetDataInstanceToUserDefaults{
NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];   
NSData *storedObject = [userDefaults objectForKey:@"MyDataKey"];
NSMutableArray *data;   

if(storedObject != nil)
{       
    NSArray *savedArray = [NSKeyedUnarchiver unarchiveObjectWithData:storedObject];
    if(savedArray != nil)
        data = [[NSMutableArray alloc] initWithArray:savedArray];
    else
        data = [[NSMutableArray alloc] init];
}else{
    data = [[NSMutableArray alloc] init];   
}   
return data; 

}

I didn’t understand where is the my problem ?

Thank you for your support

Edit : By the way I should give more detail about this problem,this function (as you can see) is storing my object. My object is custom class and storing in the NSMutableArray.

I already added these methods inside of the my custom class

-(void)encodeWithCoder:(NSCoder *)coder{
-(id)copyWithZone:(NSZone*)zone {
-(id)initWithCoder:(NSCoder *)coder{
  • 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-05-13T07:47:19+00:00Added an answer on May 13, 2026 at 7:47 am

    I think the problem is most likely in the initWithCoder: method of your custom class. It is leaking but the analyzer reports it as being in the archiver.

    Unrelated to your problem, I would caution you against using [[NSMutableArray alloc] init] to initialize collections, especially mutable collections. Instead use, [[NSMutableArray alloc] initWithCapacity:1]. I’ve seen strange problems using just init that were cleared up by using initWithCapacity.

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

Sidebar

Ask A Question

Stats

  • Questions 510k
  • Answers 510k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer Try using ISO-8859-1: public static void ExportGridView(DataGrid dataGrid, string fileName)… May 16, 2026 at 4:51 pm
  • Editorial Team
    Editorial Team added an answer Yes, that's possible with ggplot2. To preserve the visibility of… May 16, 2026 at 4:51 pm
  • Editorial Team
    Editorial Team added an answer If a library extension was easily implementable there would have… May 16, 2026 at 4:51 pm

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

i have a problem with this code: var par = []; $('a[name]').each(function() { if
I have problem compilin this code..can anyone tell whats wrong with the syntax CREATE
I have problem with this code: file = tempfile.TemporaryFile(mode='wrb') file.write(base64.b64decode(data)) file.flush() os.fsync(file) # file.seek(0)
Hi i have problem with this code, i found it on the internet and
i am a beginner and i have a problem : this code doesnt compile
I have this code, but I have a problem. When I update but do
I have this problem with my code, the page is redirecting and wouldn't stop..
hey all.i'm newbie at this problem.i have this data in table result: item range_code
I have this problem with TDrawGrid with fixed rows (although same applies to fixed
I have a problem with mysql connection. I have a php script which upload

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.