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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:27:06+00:00 2026-05-19T05:27:06+00:00

I am creating my own custom object, and I am wondering if I need

  • 0

I am creating my own custom object, and I am wondering if I need to retain my properties or use something else such as copy (which does what?)?

@interface Asset : NSObject {
    NSString *name;
    NSNumber *assetId;
    NSNumber *linkId;
    NSNumber *parentId;
}

@property (nonatomic, retain) NSString *name; // should I use retain here or something else?
@property (nonatomic, retain) NSNumber *assetId;
@property (nonatomic, retain) NSNumber *linkId;
@property (nonatomic, retain) NSNumber *parentId;

@end

Also, in my .m, do I also need synthesize as well as release?

  • 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-19T05:27:07+00:00Added an answer on May 19, 2026 at 5:27 am

    My personal preference:

    @interface Asset : NSObject {
        // no need to declare them here the @synthesize in the .m will sort all that out
    }
    
    
    // use copy for NSString as it is free for NSString instances and protects against NSMutableString instances being passed in...thanks to @bbum for this
    @property (nonatomic, copy) NSString *name;
    
    // no need for copy as NSNumber is immutable
    @property (nonatomic,retain) NSNumber *assetId;
    @property (nonatomic,retain) NSNumber linkId;
    @property (nonatomic,retain) NSNumber parentId;
    
    @end
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating my own custom content slider and am wondering what the best
I was just wondering if there are ways of creating my own custom winforms
I am creating my own custom T4 Template that integrates with an ADO.NET Entity
In google maps API v3, I'm creating my own custom map types by calling
I'm creating a my own custom User model by extending the User model provided
I've been creating a lot of my own custom attributes in my XHTML documents
I am creating a custom Table by designing my own UITableViewCell in Xcode and
So yes I'm very new to creating my own custom events. I can do
I am creating my own helper in MVC. But the custom attributes are not
I have need to use one of two custom file readers classes; one to

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.