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

Thread: Dot Syntax
View Single Post
Old 04-11-2009, 08:46 PM   #1 (permalink)
jacobhb
New Member
 
Join Date: Apr 2009
Posts: 5
Default Dot Syntax

Fairly newbish question that has been plaguing me for some time now.

I have a class called "Board"
Here is the Interface:
Code:
@interface Board : NSObject 
{
	int width;
	int height;
	int numCells;
	
	SpawnPoint *spawnPoint;
	Cell *endPoint;
	
	NSMutableArray *cells;
}
I have another class "PathNodeManager"
Code:
@interface PathNodeManager : NSObject 
{
	@private
	NSMutableArray *pathNodes;
	Board *gameBoard;
}

@implementation PathNodeManager
- (id)initWithGameBoard: (Board *) newGameBoard
{
	self = [super init];
	
	if( self !=nil )
	{
		self.gameBoard = newGameBoard;
		
		for( int i=0; i<self.gameBoard.numCells; i++)
			[self.pathNodes addObject:nil];
	}
	
	return self;
}
Now here is the question. When I use self.gameBoard I cannot use auto completion. However, if i just type "gameBoard" auto completion works fine. It seems that dot syntax does not like the "self." in front of it. My understanding is that you should always refer to member variables with a "self.". Should I just give up on dot syntax all together?

Thanks,
Jacob
jacobhb 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:36 AM.
Powered by vBulletin® Version 3.8.0
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.