4
我一直在將CGPoint轉換爲字符串時遇到問題。我嘗試了各種方法,但這似乎是最有前途的,但它仍然無法工作。有什麼建議麼?將CGPoint轉換爲字符串的問題
這裏是我的代碼:
-(void)touchesMoved:(NSSet *)touches withEvent:(UIEvent *)event {
UITouch *touch = [[event allTouches] anyObject];
coord = [touch locationInView:touch.view];
viewcoord.text = [NSString stringWithFormat:@"coordinates %@", coord.x, coord.y];
我得到的輸出,但它只是說, 「座標(空)」 我不明白爲什麼...
感謝