Advertise Books Events Forum News Social Networking Support Us

sdkIQ for iPhone
($4.99)

Shape Up
($0.99)

Your First iPhone App
($1.99)

iVidCam Free
(free)

Kid Art
($0.99)

iPUBQUIZ
(£1.19)

ArtStudio
($3.99)

Want your application or service advertised on iPhone Dev SDK?

Go Back   iPhone Dev SDK Forum

View Single Post
Old 06-29-2009, 03: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
 
Enter the iPhone App Challenge!  Win $500!
» Advertisements
» Stats
Members: 24,113
Threads: 38,883
Posts: 170,571
Top Poster: smasher (2,563)
Welcome to our newest member, taptika
Powered by vBadvanced CMPS v3.1.0

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