Hi i'm pretty new to IOS app development and I have somewhat of a problem. I created a view controller and I have a table view controller embed as a segue inside a container on the view controller.
By default the table view controller shows when I test the app. However when I add a custom class for the table view controller it does not show in the container.
What am I missing?
just follow this tutorial http://www.raywenderlich.com/5138/beginning-storyboards-in-ios-5-part-1 and http://www.raywenderlich.com/5191/beginning-storyboards-in-ios-5-part-2
and try to post some screenshots or code for better understation of you question
Got it figured out. Had to comment out the methods in the tableview sub class for data source.
Related
I am working on an app that uses parse so I used the "starter project" as a base and worked from there.
The issue I am facing is that the ViewController is controlling the login screen a well as others such as the tableView and mapView witch I added later.
As this is the case if it would be possible I would link the map outlet by simply dragging from the code to the map but obviously this is not possible, How could I solve this problem (I understand I may be looking at the problem the wrong way but any help would be appreciated)
here is the code with the map outlet
here is what the layout looks like
The MVC model, Model-View-Controller model, isn't intended to have an action in one view touch the controller of another view. In InterfaceBuilder, you should only ever be able to attach actions to the controller for that specific view.
In general, if you set the file owner to ViewController, then you can only link IBoutlets to that view controller not make to another one.
your map is available in your MapViewController not ViewController, so you need to give the reference/IBoutlet of map need to assign the MapViewController, if you want to implement in ViewController, you need to create new one map
No you have to create different file for each controller.
you cant add outlet of all in one controller
Is there a way to share a view across multiple view controller? This is for making a cheat console for my app, and that console UI should be available through out all the view controllers.
Thanks in advance.
You can create a xib file with your view, then create a class and specify this class in the view file's owner. Then you can create outlets from the xib to the class.
And then follow this article to initialise and use the view:
http://onedayitwillmake.com/blog/2013/07/ios-creating-reusable-uiviews-with-storyboard/
Instead of a view, perhaps you may want to expand what you can do with your cheat console, and instead create a seperate view controller for your cheat console, then you have your other view controllers call it as a pop over. If you are doing it though UIBuilder, when you create the segue, you would set is as Present As Popover
Good afternoon,
I would like to implement a UICollectionView inside my ViewController and I'm a little bit lost because I'm trying to read tutorials and find some good guides, but I'm unable to implement it.
I have a UICollectionView created in an another App, and it's using a UICollectionViewController, now I need to put that code inside a ViewController (without the UICollectionViewController), and it's hard for me because it's my first time implementing that view inside a ViewController.
Can you help me with some tutorial, guide or example? I want to know how to do this.
I have followed this tutorial to create the UICollectionView: http://www.techotopia.com/index.php/An_iOS_7_Storyboard-based_Collection_View_Tutorial#Adding_a_Collection_View_Controller_to_the_Storyboard and now I need to put that CollectionView in my "App" where it is going to show the user images, so in my top I'm going to have the username, userpicture, etc, etc and in the bottom I'm going to have the UICollectionView.
Thanks in advance.
In your storyboard, add a "Container View" to "ViewController". This adds a view to the view to the view controller and a "View Controller Scene" to your storyboard with a view controller at the end of "Storyboard Embed Segue". This view controller will control the content shown in the embedded view. Assign the "Custom Class" of the view controller at the end of the embed segue to be your collection view controller.
I am not at my iMac right now, so cannot supply screenshots. Give me a shout if you need them to understand what I trying to describe.
I just created a new xcode project with the 'Tabbed Application' template. I have a tabbed application with two tabs therefore two controllers. Both controllers are of type UIViewController. I made one of my controllers the 'settings' controller. I added a nav bar with a title of 'Settings'. All is well so far.
Then I add a TableView to the settings controller and make it a static table. Apparently I cannot have a static table view inside of a normal ViewController, it needs to live in a TableViewController.
Here is where I get very lost (still very new to iOS programming).
Am I supposed to delete the ViewController that the template provided and add a new TableViewController? I tried this however I cannot add a navbar to this type of controller.
Or is there some way to shove a TableViewController into the ViewController to get things to work.
I have looked all over today and most examples of TableViewControllers I have found are not in a tabbed application so they just create a TableViewController and move on.
Oh I also need to be compatible with iOS 5. Not sure if that makes a difference with TableViewController stuff.
Any help would be greatly appreciated.
Thanks.
Update: other option: you can follow this tutorial too.
Yes, of course you can:
Delete de UIViewController
Add to your storyborad a new TableViewController
Select it and go to Editor Menu->Embed In->Navigation Controller
Connect it to your tabbar in the storyboard
Update: other option: you can follow this tutorial too: Tutorial: Storyboard in XCode 4.2 with Navigation Controller and Tabbar Controller (Part 1)
Hope it helps!
Is it possible to create a storyboard segue from a view controller to itself? I have a bunch of Entities that have Related Entities. I'd like to be able to display a Related Entity using the same view controller that's displaying the Entity. But I can't seem to create a segue that will display a new instance of the origin view controller.
Is it just not allowed? Thanks!
Well here's a solution that isn't quite the same but gets me what I want. I found it as an answer to this question.
The reason I thought I had to use a segue rather than the good old programmatic push of a view controller onto the navigation controller's stack is that I had set up the view controller's IBOutlets in the storyboard. I didn't realize that you could create a copy of the view controller as laid out in the storyboard without using a storyboard segue. You can! To see how to do it, check out that other question and up vote the answerer!
You can ctrl-click-drag (or right-click-drag) from an element (UIButton, etc.) to the containing view controller.
(Did you try this? I'm doing it right now; I have one stock UIViewController that just keeps adding itself indefinitely to the containing UINavigationController stack via a normal push segue.)
Yeah, it's annoying I can't do a 'manual' segue to itself.
What I did was added a UIButton to my view and gave it an action of push to the same view controller, and then made this button hidden. Then I can name the segue and reference it in the code.
Hacky, but works.