Click here to Skip to main content
15,887,854 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have a custom cell with a button inside. Is there a way I can access a variable from mainVC.m to customCell.m in the buttons action method?

I can do like this: mainVC main = [[mainVC alloc] init];, but that would make a new main file. I need to access the original.
Posted

1 solution

Yes. You must connect the button action to the vc. In it you have the sender, which is your cell. If you cast properly.

If you build the button in the interface builder you can also connect it to an outlet.

My tip is, that you learn some stuff about the interface builder. Please read the tutorial of Ray Wenderlich and play around.
It will help you more than asking ;-)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900