how to distinguish between ccTouchesEnded() where finger was lifted and where finger slid off screen

I need to be able to distinguish between these two situations which both lead to a call to ccTouchesEnded():

A: The user lifts his finger away from the glass.

B: The user’s finger slides off the edge of the screen.

When testing this, I can slide my finger off-screen, but keep it against the glass, and then move back onto the screen (having never lifted my finger), and the tracking of that finger ends when i slide off and a new one begins when i slide back on.

FINGER DOWN

Cocos2d: MOVED {532, 20}
Cocos2d: MOVED {533, 20}
Cocos2d: MOVED {534, 20}
Cocos2d: MOVED {535, 20}
Cocos2d: ENDED {538, 17} << SLID OFF-SCREEN
Cocos2d: BEGAN {533, 17} << SLID BACK ONTO THE SCREEN
Cocos2d: MOVED {531, 18}
Cocos2d: MOVED {531, 19}
Cocos2d: MOVED {531, 20}

FINGER UP

I need to be able to ignore the ccTouchesEnded() and ccTouchesBegan() (when it’s detected that it’s from sliding off the screen) so that the whole session is treated as a single action/swipe.

May be you should track finger position than compared to the position of ccTouchesEnded.
As i know, iPhone and Android can not distinguish them.