NSLog with CGPoint data

前端 未结 6 1254
旧时难觅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:28

    point.x is a floating point number so you should code like this:

    NSLog(@"%@",[NSString StringWithFormat:@"%f",point.x]);
    

提交回复
热议问题