Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

Graves Robber
($1.99)

African Adventure
($0.99)

iTazer
($0.99)

ArtStudio
($3.99)

Pigs Vs Wolves
($1.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-28-2009, 02:08 PM   #2 (permalink)
smasher
Senior Member
iPhone Dev SDK Supporter
 
smasher's Avatar
 
Join Date: Jul 2008
Location: San Mateo, CA (San Fran)
Posts: 2,539
Default

Quote:
Originally Posted by neduhamel View Post
So the class B does NOT inherit from class A, but it is a subclass (is this the right term?) of the class A.
If class B does not inherit from class A, then "subclass" is probably not the right word. Subclass would imply, to me, that B inherits from A. Let's say they have a parent-child relationship instead.

If class B only needs to know its parent in a certain method, you could pass the parent into that method. Otherwise, if B needs to contact its parent a lot, you could give class B an instance variable called "parent" , and write an initWithParent: method that sets the parent variable. If the parent changes a lot, you should probably make b.parent a property instead.
__________________
smasher is offline   Reply With Quote
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 23,591
Threads: 38,347
Posts: 168,505
Top Poster: smasher (2,539)
Welcome to our newest member, gotaway
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 09:34 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.