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

Thread: Dot Syntax
View Single Post
Old 04-11-2009, 09: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
 

» Advertisements
» Online Users: 779
21 members and 758 guests
ADY, AngryOrange, antonwilliams, apatsufas, bocaraton, Domele, Hirley2324, ilmman, iphone.savvy, J.Steve, MarkC, mavericki, saqibjaan, smarkmee, srilu, stekki, suresk, Thompson22, tomtom100, vhenziel8
Most users ever online was 1,187, 10-11-2011 at 08:09 AM.
» Stats
Members: 158,628
Threads: 89,144
Posts: 380,338
Top Poster: BrianSlick (7,110)
Welcome to our newest member, bocaraton
Powered by vBadvanced CMPS v3.1.0

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