Sorry, I should have mentioned I have activated it. I'm just wondering how u track between touches, it says something I'm the docs about copying the status of each touch object but I'm not sure what that means and how I would use it to know which touch is which.

wonza Wrote:Sorry, I should have mentioned I have activated it. I'm just wondering how u track between touches, it says something I'm the docs about copying the status of each touch object but I'm not sure what that means and how I would use it to know which touch is which.

Although it's not clear at all in the documentation, each touch object is persistent from "began" to "end/cancelled". So you can save a pointer to each touch object or use their hashes to identify them in the next callback.

Frank C. Wrote:Although it's not clear at all in the documentation, each touch object is persistent from "began" to "end/cancelled". So you can save a pointer to each touch object or use their hashes to identify them in the next callback.

Thanks for pointing this out. I just re-read the UITouch class documentation, and you're right -- it's not plainly obvious. In fact, it's kind of buried in a single sentence in the overview.

Just be sure that if you do "save a pointer" to a UITouch instance, you're not retaining it. In that same overview section, the docs say you should never do that.

wonza Wrote:dont suppose you have a little sample code for me? I need spoon feeding sometimes mainly because Im still not that used to C yet.

Well you'll need to brush up on your Obj-C if you want to get anywhere with the SDK but basically when you get your UITouch objects in touchesBegan you'd stick the hashes into some variable/class/structure you can access later - e.g.:

Code:

myhash = [touch hash];

Then in touchesMoved/Ended you compare your saved hashes with the new touches and do whatever you need to do: