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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T19:55:00+00:00 2026-06-04T19:55:00+00:00

I deleted the previous post … Which one do i use if I have

  • 0

I deleted the previous post …

Which one do i use if I have a class that owns an object objA? I know if the object wasn’t own by the class,it needs to be retained.

@class A

@property (retain) ObjectA objA;

@end

@implementation A

-(void) func {
   self.objA = [[ObjectA alloc] init];
}

@end

If objA in class A is set as a retain, and was initialized in func using init function. Would this give 2 retain count or just 1 retain count.

  • 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-04T19:55:01+00:00Added an answer on June 4, 2026 at 7:55 pm

    alloc gives retain count 1.
    self.objA = will give retain count 2 (because of the retain property)

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

Sidebar

Related Questions

I accidentally deleted my previous post. Could I know exactly why I should compile
I have two dependent models with one to many association class Post < ActiveRecord::Base
I have deleted my previous question and post this updated: I have a an
I have a PHP application, which has a delete function on one of the
First, here is the previous post that deals with the ListBox AccountListBox data binding
First Problem: When user deleted particular row then i have to remove that row
I have asked pretty much the same thing before, but my post got deleted
I deleted my previous git origin, and created a new one. I did git
I deleted my old post as it contained a lot of spam. And I
I accidentally deleted a few files from my local git repo. I have not

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.