returning the location string store in the method
I was building a monopoly board game using command line using xcode. I was
able to create board and tiles on board but i have problem trying to
return the player's location on the board. the following is my code,
-(NSString *) description
{
NSString *_playerresult;
_playerresult = _name;
return _playerresult.description;
}
-(NSString *) currentLocation
{
return _isOn.description;
}
as you can see, description is a string variable that stores the result.
In main, i put p1.currentlocation so that the program can return the
player's location but it doesn't. it prompt Tile: 0x10010ac90
No comments:
Post a Comment