NSLog with CGPoint data

前端 未结 6 1218
旧时难觅i
旧时难觅i 2020-12-22 21:05

I have a CGPoint called point that is being assigned a touch:

UITouch *touch = [touches anyObject];

CGPoint point = [touch locationInView:self];
         


        
6条回答
  •  隐瞒了意图╮
    2020-12-22 21:20

    Actually, the real easiest way to log a CGPoint is:

    NSLog(@"%@", NSStringFromCGPoint(point));
    

    The desktop Cocoa equivalent is NSStringFromPoint().

提交回复
热议问题