Get text of button from IBAction – iPhone

The sender should be the control which initiated the action. However, you should not assume its type and should instead leave it defined as an id. Instead, check for the object’s class in the actual method as follows: – (IBAction)onClick1:(id)sender { // Make sure it’s a UIButton if (![sender isKindOfClass:[UIButton class]]) return; NSString *title = … Read more

Can you add a UITableViewController’s TableView to another View?

You’re on the right track! Here’s what you need to do: Create a standard UIViewController subclass with its accompanying view xib. Add a UITableView in the XIB. Wire everything up. The view controller will be the delegate and the datasource for your table, so you must implement both protocols. In your implementation file, add all … Read more