Advertise Mobile SDKs Books Events Forum News Social Networking Support Us
Follow @iphonedevsdk on Twitter

Mockup & CodeGen, iPhone & iPad
($9.99)

Make your own iPhone apps
and run them live!
(free)

Manu
($0.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: 3,858
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.
__________________

Free Games!
smasher is offline   Reply With Quote
 

» Advertisements
» Stats
Members: 158,724
Threads: 89,183
Posts: 380,500
Top Poster: BrianSlick (7,125)
Welcome to our newest member, blog08space
Powered by vBadvanced CMPS v3.1.0

All times are GMT -5. The time now is 12:24 PM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.