• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Simple instance [[alloc] init] question.
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple instance [[alloc] init] question.


  • Subject: Simple instance [[alloc] init] question.
  • From: "Frederick C. Lee" <email@hidden>
  • Date: Mon, 30 Aug 2010 17:23:23 -0700

Which is the preferred method of object allocation & initialization?

<header file>.h
@property(nonatomic, release) IRMSerialDetailsDO *serialIDs;
...
<body>.m
@synthesize mySerialIDDO

...
// 1)
self.serialIDs = [[IRMSerialDetailsDO alloc] init];

or...

// 2)
IRMSerialDetailsDO *mySerialIDDO = [[IRMSerialDetailsDO alloc] init];
self.serialIDDO = mySerialIDDO;
[mySerialIDDO release];


I would assume #1 is the simplest, but I see a lot of #2 .

Thoughts?

Ric.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Simple instance [[alloc] init] question.
      • From: Charles Srstka <email@hidden>
    • Re: Simple instance [[alloc] init] question.
      • From: Dave Geering <email@hidden>
    • Re: Simple instance [[alloc] init] question.
      • From: Brian Slick <email@hidden>
  • Prev by Date: Re: Style question
  • Next by Date: Re: Simple instance [[alloc] init] question.
  • Previous by thread: Re: core data issues iOS 4.0.2
  • Next by thread: Re: Simple instance [[alloc] init] question.
  • Index(es):
    • Date
    • Thread