I have a UITableView and inside it I create a custom UITableViewCell in the follwoing way:
ItemCellController *cell = (ItemCellController *)[tableView dequeueReusableCellWithIdentifier:ContentListsCellIdentifier];
...
cell = [[[ItemCellController alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ContentListsCellIdentifier] autorelease];
I do this to can get touchesBegan and touchesEnded events (so that I can implement a long touch). Using NSLog I can see that the longTouch is called properly from within the touchesBegan method using the following code:
timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(longTouch:) userInfo:nil repeats:YES];
The problem is that I am not able to call a modal window from within the longTouch method.
I tried the following, but I get an NSInvalidArgumentException -[ItemCellController navigationController]: unrecognized selector sent to instance error.
AddItemController *addView = [[AddItemController alloc] initWithNibName:@"AddItemView" bundle:nil];
UINavigationController *controller = [[UINavigationController alloc] initWithRootViewController:addView];
controller.navigationBar.barStyle = UIBarStyleBlack;
[[self navigationController] presentModalViewController:controller animated:YES];
[controller release];
So the question is, how can I call up a modal window from within a custom UITableViewCell.
Thanks