I have a class, clickableImage. clickableImage has a callback variable for a function.
When you assign the callback function, I add a gesture recoginizer.
clickableImage has a function 'tapped' which just listens for the tap event as illustrated below.
private func tapped(tap:UITapGestureRecognizer)
{
println("Here")
if(_touchCallback != nil)
{
touchCallback(self)
}
}
var touchCallback:((K_PreviewImage)->Void)
{
set{
if(_touchCallback == nil)
{
var tap:UIGestureRecognizer = UITapGestureRecognizer(target: self, action:"tapped:")
self._image.addGestureRecognizer(tap)
}
_touchCallback = newValue
}
get{
return _touchCallback
}
}
When I tap this image, the app crashes, with only (llb). The println() does not get called. I tried enabling zombies and I 'SOMETIMES' get a message "message sent to deallocated instance".
The image is NOT delloacted, otherwise I wouldn't be able to CLICK on it!
If you have ANY idea what is going on, you would be a live saver