I have a UITableView cell which responds to events like a slider's value changes etc... On certain occasions I need to run a method from the parent class when the user does things with the UITableView cell controls. I cant seem to access methods from my parent class. Is it possible? Thanks
Check out this password generator app that shows various techniques including using a data container singleton object to share data between objects in your project.
UITableViewCell does not inherit from UIViewController. If you are calling [super whatever] in your UITableViewCell, and trying to access a method of UIViewController, you will throw an error, because those classes are not related.
If you've subclassed UITableViewCell, then it's parent is UITableViewCell. Then it's parent is UIView, then UIResponder, and finally NSObject.
Doctor's orders:
1. Why don't you just tell us specifically what you are trying to do in your UITableViewCell?
2. Google and read up on subclasses and superclasses.
3. Google and read up on class inheritance.
4. Google and read up on object oriented programming. There's actually an active thread in this forum that would explain how to do what you are trying to accomplish. The problem is you don't know enough about programming to know what it is you're actually trying to accomplish.
Last edited by radio_goober; 04-30-2011 at 11:08 PM.
I only want to do this because in my first class I have a lot of variables which some of my methods use and since I cant access them from the uitableviewcell...
You should be working the other way around. Your UIViewController class should do the work, and call your table cell class, and not the other way around. That's why Apple made it easy for UIViewController to find a table cell, and difficult to do what you are trying to do.
Give us more details on what you are trying to do if you can't figure out how to reverse your logic.