• 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 with something....
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Init with something....


  • Subject: Init with something....
  • From: Sandro Noel <email@hidden>
  • Date: Sat, 9 Dec 2006 22:29:38 -0500

Greetings.

Another one,

when i create a class,
I override the init like this,...

- (id) init{
		if ((self = [super init])) {// superclass may return nil
			// do init code here.
		}
		return self;
}

but what if i want to init with a file's content,

I still want to call the init method, for my normal init code to run.
so would this be a good way of doing it ?
of am i over/miss doing it again ....

- (id) initWithFile:(NSString *) path{
		if ((self = [self init])) {
			[self loadFile:path];
		}
		return self;
}

again thank you and please forgive, if my questions seem very beginner type :)

Sandro Noel.
_______________________________________________

Cocoa-dev mailing list (email@hidden)

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: Init with something....
      • From: Nir Soffer <email@hidden>
    • Re: Init with something....
      • From: Daniel Jalkut <email@hidden>
  • Prev by Date: Re: Simple scope check.
  • Next by Date: setFetchPredicate binding question
  • Previous by thread: Re: change desktop picture on all displays
  • Next by thread: Re: Init with something....
  • Index(es):
    • Date
    • Thread