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-29-2009, 04:05 AM   #5 (permalink)
neduhamel
New Member
 
Join Date: Jun 2009
Posts: 5
Default

i'm sorry, i feel like if i do as you say, it's gonna create a endless loop as the child will have a member which is the parent which has a child which has a parent....and so on. Am i wrong?
Here's what i understand from your advice:

Code:
//class_A.h
//-----------
@interface class_A 
{	
@public
    class_B my_class_B;  
}
-(void)init;
@end
Code:
//class_A.m
//-----------
@implementation class_A
	
-(void) init
{
    [my_class_B initWithParent:self]; //is this ok?
}

@end
Code:
//class_B.h
//------------
@interface class_B
{
@private
    class_A my_parent;  //This what i doubt is good...
}
-(void) initWithParent: (id) parent;
@end
Code:
//class_B.m
//------------
@implementation class_B

-(void) initWithParent: (id) parent
{
     self=[super init];
     if (self){
          my_parent=parent;
     }
     return self;
}

@end
neduhamel is offline   Reply With Quote
 

» Advertisements
» Online Users: 766
20 members and 746 guests
ADY, AppleSteve, betterlee, blueskysinger, ckgni, clovisbear, Domele, femenina, Floras2324, hasinthajanaka, ilmman, jkigel, JohniARivera, KarlJay, NoGameJoe, oceanlablight, prerna chavan, saqibjaan, suresk, zom888
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,621
Threads: 89,141
Posts: 380,328
Top Poster: BrianSlick (7,110)
Welcome to our newest member, Floras2324
Powered by vBadvanced CMPS v3.1.0

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