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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T17:14:48+00:00 2026-06-08T17:14:48+00:00

I am trying to make sense, on why the following code is causing leaks.

  • 0

I am trying to make sense, on why the following code is causing leaks. So I have the following custom init method:

@property (nonatomic, retain) NSString *userId;
@property (nonatomic, retain) NSString *text;
@property (nonatomic, retain) NSString *username;
@property (nonatomic, retain) NSString *creatorName;
@property (nonatomic, retain) NSString *profilePicture;
@property (nonatomic, retain) NSString *imageId;
@property (nonatomic, retain) NSString *imageLink;
@property (nonatomic, retain) NSString *createdTime;
@property (nonatomic, retain) NSMutableArray * imageLikes;
@property (nonatomic, retain) NSMutableArray * imageComments;
@property (nonatomic, retain) NSDictionary *image;
@property (nonatomic, assign) int commentsCount;
@property (nonatomic, assign) int likesCount;
@property (nonatomic, assign) int index;
@property (nonatomic, assign) int numberOfRows;
@property (nonatomic, assign) BOOL increaseHeight;
@property (nonatomic, assign) BOOL userHasLiked;
@property (nonatomic, assign) BOOL canResetHeight;

-(id)initWithData:(NSDictionary *)data
{
    self = [super init];
    if (!self) {
        return nil;
    }

    self.text = [[data valueForKey:@"caption"] valueForKey:@"text"];

    self.createdTime = [[data valueForKey:@"caption"] valueForKey:@"created_time"];
    self.imageId = [data valueForKey:@"id"];
    self.imageLink = [data valueForKey:@"link"];
    NSDictionary *from = [data valueForKey:@"user"];
    self.username = [from valueForKey:@"username"];
    self.profilePicture = [from valueForKey:@"profile_picture"];
    self.creatorName = [from valueForKey:@"full_name"];
    self.userId = [from valueForKey:@"id"];

    self.userHasLiked = [[data objectForKey:@"user_has_liked"] boolValue];

    self.commentsCount = [[[data valueForKey:@"comments"] valueForKey:@"count"] intValue];
    self.likesCount = [[[data valueForKey:@"likes"] valueForKey:@"count"] intValue];

    self.image = [data valueForKey:@"images"];


    self.increaseHeight = NO;
    self.numberOfRows = -1;

    return self;
}

-(void) dealloc
{
    [createdTime_ release];
    [imageLink_ release];
    [imageId_ release];
    [imageLikes_ release];
    [imageComments_ release];
    [username_ release];
    [userId_ release];
    [profilePicture_ release];
    [text_ release];
    [creatorName_ release];
    [super dealloc];
}

Any idea why?

  • 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-08T17:14:49+00:00Added an answer on June 8, 2026 at 5:14 pm
    -(void) dealloc
    {
        [createdTime_ release];
        [imageLink_ release];
        [imageId_ release];
        [imageLikes_ release];
        [imageComments_ release];
        [username_ release];
        [userId_ release];
        [profilePicture_ release];
        [text_ release];
        [creatorName_ release];
        [image_ release]; // add a code
        [super dealloc];
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i am trying to make sense of the following result. The test case code
I'm trying to make sense of a situation I have using entity framework on
Sometimes JavaScript doesn't make sense to me, consider the following code that generates a
I am trying to understand virtual memory paging. I have the following code snippet
After trying to make sense of the Metrics and Grids page of the (fairly
So for some reason this just doesn't make sense to me. What Im trying
I have the following code, see below: $(document).ready(function(){ var prefixNumber = $('.numeric').val(); if(prefixNumber.match(????){ prefixNumber.addClass('.field-error');
I'm working through R Murphy's JQuery Fundamentals and am trying to make sense of
I am trying to make sense of whatever I learned about NPRuntime . Here
I was trying to make a simplified version of my code for this question

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.