Cocoa Touch: Accessory view never calls "up outside" action?
Cocoa Touch: Accessory view never calls "up outside" action?
- Subject: Cocoa Touch: Accessory view never calls "up outside" action?
- From: "email@hidden" <email@hidden>
- Date: Sun, 10 Jul 2011 00:54:08 -0700
I'm using a UIButton subclass as an accessory view in a table cell. I create the button in my cell's initWithStyle:reuseIdentifier: method, as shown below.
Here's the problem: I touch inside my button, but even when I drag my finger out of the button and lift up, it's my "up inside" action that gets called, not my "up outside" action as I expect.
Puzzling.
Any help appreciated.
_murat
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
if (self)
{
self.accessoryView = [[[CustomButton alloc] initWithFrame:CGRectMake(0, 0, 40, 10)]autorelease];
[(UIControl*) self.accessoryView
addTarget: self
action: @selector(inside:forEvent:)
forControlEvents: UIControlEventTouchUpInside];
[(UIControl*) self.accessoryView
addTarget: self
action: @selector(outside:forEvent:)
forControlEvents: UIControlEventTouchUpOutside];
}
return self;
}
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden