• 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
init and dealloc
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

init and dealloc


  • Subject: init and dealloc
  • From: Lorenzo <email@hidden>
  • Date: Thu, 29 Jan 2004 23:09:26 +0100

Hi,
I init a subclass of NSObject this way:

- (id)initWithData:(NSData*)theData sender:(id)sender
{
self = [super init];
if(!self) return nil;

if(![self checkData:theData]) return nil;

owner = sender;

return self;
}

Now, if I return "nil" because of checkData returns NO,
what should I write to the dealloc method? This?

- (void)dealloc
{
[super dealloc];
}


Also, I use all the time the trick of the "sender" when I init some object,
so, from the object, I can call the creator of the object. Is this the
correct procedure or is there a better way to get the creator of the object?


Best Regards
--
Lorenzo
email: email@hidden
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: init and dealloc
      • From: Shawn Erickson <email@hidden>
    • Re: init and dealloc
      • From: marquis logan <email@hidden>
  • Prev by Date: Re: [NSBezierPath bezierpath]
  • Next by Date: Problem with CircleView Example and NSLayoutManager angles...
  • Previous by thread: Re: I need help with "Preferences" routines.
  • Next by thread: Re: init and dealloc
  • Index(es):
    • Date
    • Thread