-->

Error : Xcode 4.6.3 - Method dragFromToForDuration

2019-07-30 01:28发布

问题:

I use method dragFromToForDuration to test my app on iPad. This method intends to tap and hold then drag an image to another location on the iPad's screen. I define exactly location of both the image and the targeted area. However, implementing this method generates an error:

target.dragFromToForDuration({x:startCoord.x, y:startCoord.y}, {x:finishCoord.x, y:finishCoord.y}, {duration:3});

[_NSCFDictionary doubleValue] : unrecognized selector sent to instance 0x1f83e5d0

Update: If I remove the word "duration" and the code became: target.dragFromToForDuration({x:startCoord.x, y:startCoord.y}, {x:finishCoord.x, y:finishCoord.y}, 3);

With this changing, xcode does not generate any error/warning and go through it without any action on the screen. Anyone encountered this problem?

回答1:

This function works well after modifying the startPoint and endPoint of target. I did not see this fault but my fellow did. :)