You have released target when you clicked, You can hold the CustomClass object on the current parent view.
The second method works because the type does not need to be held and will not be released.
The control does not retain the object in the target parameter. It is your responsibility to maintain a strong reference to the target object while it is attached to a control.
Detailed reference