Connecting second UITableView in 2nd tab of UITabBarController to class file? - iphone

I have problem with creating a second UITableView in a new tab of a UITabBarController.
My App:
1st tab has a UITableView shows feeds from a website. It works fine!
2nd tab, I want to create a NEW UITableView showing different information. I am able to create an empty UITableView in the main XIB file, also created a new class files for the new UITableView, but I cannot figure out how to connect the new UITableView in 2nd tab to the new class files I created.
Thanks for reading.. Hope you understand my question.. Thank you!!!!

select main XIB file, it will open interface builder view. Open utilities view->go to identity inspector->select you tableview controller->add class name to identity inspector for your tableview.

Related

View controller suddenly wont connect to .h file

I created a new View Controller, I then opened up and created a new filed (Objective-C class) and then created a subclass of UIVewcontroller. I added my table views and labels in story board and now suddenly it wont connect them to the .h subclass Ive created. Any suggestions?
You have to name that the view controller is part of your class. Select your view controller and on the third tab on the right write the name of your view controller. Here is a picture I got from this tutorial to help:

Xcode 4.5 not creating xib file

I have created SimpleView based application, in which i want to add new file with .xib interface but when i add new file then Objective-C class and then subclass of UITableViewCell there option of with xib for user interface is disabled i also want to add xib..
How to add new files with .xib interface ?
Here are screenshots..
Thanks for reading..
Only certain classes such as UIViewController will have the nib option enabled. UITableViewCell is not one of these classes.
I don't know why this is disabled. And I couldn't remembered that was it enable in previous versions of xcode.
But you can add xib for custom cell as described in this tutorial.
Here is the quick steps
Create a simple view XIB
Drag a table view cell into the XIB from the object browser in the bottom right corner
Delete the superfluous view
Make sure also that "iOS" is selected, and not "OSX" when choosing a template for your new file. When "OSX" is selected, the option was disabled in my project.
for UITableViewCell you will not have xib for that we have add an empty view by selecting userinterface while adding new file. Then drag and drop uitableview cell.

tabbed navigation in tableview section header

I'd like to mimic the behavior of profile page of pinterest app.
You can tab on Boards/Pins/Likes(tableview section header) and, tableview changes accordingly.
Below are screenshots to illustrate this.
Suppose I can create each of the tabs(boards/pins/likes) in separate viewController.
Also suppose I want to reuse the code of each viewController because other views(such as 'following' tab on the tab bar) look very much like one of them(boards/pins/likes).
How would I share a table header & table section header and also separate codes enough so that I can reuse bulk of them?
Basically, I have two viewControllers with tableview.
Now I want to create a new viewController with a tableView header/section header that user will tab to see one of the previous two viewController's view.
I don't think the tab appear in Table Header, instead it might be a view subclassing UISegmentedControl. If you want to reuse it you can create the interface in xib file and link it with your view controller
try check this github project https://github.com/rs/SDSegmentedControl for custom UISegmentedControl

PullRefreshTableView editing

I have a PullRefreshTableView from leah(https://github.com/leah/PullToRefresh). Problem with this, as soon as I implement this. The view is changed to a tableview by doing this:
#interface news : PullRefreshTableViewController {
So I can't add any toolbars or navigationcontrollers to the top. Does someone know how I can add a toolbar to the top of the screen in combination with the PullRefreshTableView.
Thnx!
You know when you have this standard UINavigation template when you create a new project with xcode? Gives you 3 ( right ? ) nib files, 1 with the window, 1 with the mainview / navigation controller and the other one contains the tableview.
Open the one with the tableview. Select the tab that looks like this:
It will allow you to change the class it creates when the nib file is loaded. Change it to the PullRefreshTableView and when you launch the application a PullRefreshTableView will be created instead of a normal table view.
You can hook this up as an Interface Builder outlet exactly the same way you would hook up a normal table view. Its a subclass so it should even be able to be connected to the normal tableviewcontroller that is included in the template.
If you have done this, you should still be able to add the toolbars like you did with a normal table view. Also, if you want to have a toolbar on your iphone screen it shouldn't be a subview of the Tableview, but a container view should contain both the toolbar and the tableview.

iPhone Dev: Tab View controller. Buttons on first view don't show actions in File's Owner

Hey all, I'm really new to iphone development and am getting really frustrated. I know ASP and Javascript and i'm trying to do this objective-c. I took a course on lynda and now i'm trying to hook up a tab view.
I placed buttons on the first view of the tab view controller. I then went into the header file and created the - (IBAction) for the 4 buttons on there and added the function in the implementation file. The problem is when i go back to Interface builder and try to connect the actions to the buttons, they don't show up. I have no actions listed in the File's owner so i can't do anything. Can anyone out there please help! thanks.
damien
You're doing it backwards (IMHO). create the Actions and Outlets (don't forget to save the source), then create the items in IB (note that you have to refresh IB so that it can re-read the source.
In tab view controller app make sure that class of view is your ViewController class and also in MainWindow.xib make sure all tabs are referencing respective ViewController