I am looking to create a subclass for my TableViewController but when I go on the menu bar to create new file then a subclass the option to create it is not there.
Can somebody explain to me why this is the case please?
Should be like this:
And then this:
It is surprisingly simple. Make sure you've selected the right section.
Related
I started my app as a single view application. I have the view with various buttons and labels connected to code. I want to add a button that links to another view.
I found a tutorial that guided me to click on the project and add a UIView subclass. However there is no option for that ( I think because I started it as a single view application).
I'm pretty new to all this so if anyone can outline a simple way for me to do this that would be great! I am using Xcode version 4.3.2.
Thanks!
You need to add a new Objective C class. Please refer to this:
How to create new View Controllers in XCode 4.3
If you started the app as single view using xib file the to add a class just go to name of the project on the left pane and right click on it. Then choose add new file. The pop up will appear to allow you to choose what type of class you want to add. Depending to what the new view is you can choose uiview controller or uitableview controller and so on. Just make sure you check mark with xib for interface user. That should do it. Hope it helps.
Adrian
I am working on adjusting all my iPhone screens to the new iPhone 5 4" screen. To make the code easier to manage i would like to use an NSObject class to do this that calls on a ViewController to move a button or whatever needs to be moved.
Would someone please give me some hints how to accomplish this or if there is a better way of doing this.
I recommend you look into using Auto Layout. It will do everything you need.
If you are talking about autoresizing then i am sure the shared link will work
Autoresizing masks programmatically vs Interface Builder / xib / nib
you can resize your button and view programmatically as well as using interface builder.
Just a concept question.
What would you prefer doing and why, should you need to insert into a view a subview, would you rather have a nib file to add it or would you programatically insert it?
I am talking about xcode 4.~ development using storyboards.
Regards, Guy.
That depends on your situation. If it's something very simple or something dynamic (variable number of buttons for example) then I would do it programmatically. If it's a complex but static view (something like a settings view) then I would try using IB.
I personally will do it programmatically if i need the view to be dynamic. But it can be done even with the view created in the xib file. I would prefer creating in xib if the the view needs no dynamism so that it would reduce my coding portion
I am becoming one sad stackoverflow-er (not flower ) :S
I would like to know the explicit steps required to add a UITableViewController as the detail view of a splitViewController using xCode and Interface Builder. This is an iPad application, so it does not have to run on the iPhone
I have gone through a number of tutorials that create UISplitViews, so I understand the concept. But each of these tutorials add a webview, or simple view controller that shows an image.
The left side of the split view shows a list of menu items that I can customize. that's the popover. no problem.
the right side needs to be a UITableViewController that I an descend and ascend that will have menu items based on the button clicked on the left hand popover.
I also looked this link - http://www.cimgf.com/2010/05/24/fixing-the-uisplitviewcontroller-template/ but the discussion appears to note that it's a "hack" rather than an recognized workflow.
anyone help a brother programmer out? steps are appreciated.
regards,
Edard
Check out any of the examples on the net. Then take the detailViewController and turn it into a UITableViewController.
Alternatively, you can check out the UISplitViewController Class Reference.
I'm an iOS developer. I recently started my Mac project, but I found that unlike UITableViewCell, which is a subclass of UIView, the cell of NSTableView is NSCell, and I even can't create it in IB. I wonder if there are some easy ways to create subclass like NSTextFieldCell to put it into the NSTableView.
Any help would be appreciated! Thanks!
Have a look at the open source PXListView class on Github
This has a PXListViewCell that you can use as an example.