I have got an UITableViewCell and I want to call a void in a ViewController of the UITabBar in it. Is that possible using [UIApplication sharedApplication]? If yes, how can I do that?
Thanks in advance.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
This is pretty vague, the answer is yes, it is possible to do such a thing. You just need to design your classes in such a way to make it possible.
A number of ways to approach it
ViewController‘s interface thatUITableViewCellcan callViewControllerWith that said, this sounds weird to me, why would your UITableViewCell act on a UITabBar? The interaction “feels” strange. Usually touching a cell in a table does not change the tab that the user is on, it could be fairly confusing. If that is not what you’re doing, then why is this method in the ViewController that controls the UITabBar? You may need to separate your concerns.