ok, this is maybe a newbie question but i need help with it.. I have a someview.m and in it a custom cell which is defined in customCell.h and .m So in someview.m i have
Take 1 variable in customCell.h
like
@property (nonatomic,strong) UIView *parent; //Assuming someview is UIView, if it is UIViewController than change UIView to id
now in following method
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
customCell *cell=[tableView dequeueReusableCellWithIdentifier:@"charCell"];
if (cell == nil || (![cell isKindOfClass: customCell.class]))
{
cell=[[customCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:@"charCell"];
}
cell.parent = self;
return cell;
}
now in
-(BOOL)textFieldShouldReturn:(UITextField *)textField
{
[_parent printStuff]; //Call like this.
return YES;
}
Hope this helps, Let me know in case of any query.