Xamarin iOS Visual Studio - Can't select Show Detail Segue - xamarin

I'm following along with the Stanford CS193P Swift/Xcode course using C# with Xamarin.iOS in Visual Studio.
It's gone mostly okay despite some differences, but I am seeing weird behavior when creating segues in the designer that I can't resolve. It is hard to put into words, but basically I control-drag from a button to a view controller, select 'Show Detail' and it creates the Segue - I can see the 'S' in the circle on the Segue line. When I select the Segue, to give it an identifier, the Segue dropdown in the 'Widget' tab of the properties cycles through a few values and the ends up half height with no selected value, and the circled 'S' changes to a 'P' for popover.
A gif better demonstrates this:
Edit:
Steps to reproduce
Create a new Visual C# > iOS > Universal > Single View App project
Delete the default View Controller
Drag a Split View Controller out and delete the default View Controllers
Drag two View Controllers out and create master/detail relationships
Add a button to the master
Ctrl-Drag from the button to the detail and select 'Show Detail'
Select the newly created Segue

Fixed in Cycle9 which at the time of writing is in Alpha (per bugzilla.xamarin.com/show_bug.cgi?id=44401)

Related

How to remove a navigation controller in storyboard?

I am following a simple swift tutorial that shows how to add a navigation controller to a viewcontroller in storyboards in xcode. This is done using Editor > Embed in > Navigation Controller
The problem is, once the navigation controller is embedded, it cannot be removed. The 'unembed' option is always greyed out. Removing the controller view from the storyboard results in an error. Even if the arrow indicating the first view is pointing to a simple empty view in exactly the same way as when you're starting a new project.
I would expect that there is still some code from the Navigation Controller lingering around somewhere, but how to pinpoint it?
I follow this step.
1) select navigation controller and delete connection.
2) make root view to your view controller
No...there is no source code, don't worry.
If your changes are hot then just Control-Z if not select navigation controller and press delete button.
"unembed" function is for unembedding the "stack" in stackView and not for "navigation controller" nor "tab bar controller"

Add a second UIViewController within a single-view application

I have a single-view application open. I need to have two storyboard views (UIViewControllers), because one is a Table View, but when one of the Table View elements is selected it brings up another screen with a normal UIViewController. Is there any way of creating a second storyboard view (UIViewController)?
Of course! Those templates Xcode provides are in no way "set-in-stone". When Xcode created your Single-View Template, it just gave you a base for creating something more. You can create additional classes, view controllers, views, and resources (other than what Xcode starts you off with in a few ways).
To add another View Controller to your Storyboard, just drag and drop one from the Object Library:
It seems like you do not have a basic understanding of using or developing with Xcode. I would recommend reading over all of Apple's documentation on Xcode before going any further. The Building A User Interface section may be of particular interest to you.

Connecting code to UI in storyboard with multiple ViewControllers, Xcode

I have a storyboard project in Xcode. I have added an additional ViewController and dropped in a button, text box, etc. I can get from the initial to the secondary View Controller, but I cannot seem to be able to connect the button to the code. I've tried adding additional classes with XIBs and even from a blank adding in the XIBs. How do I connect the code I have written for a button to do work on the second View Controller?
If you have the button created on the storyboard. You have to make an
-(IBAction)clickButton...
in the .h and .m code files. You can easily connect the code to the button by dragging the line from the dot (in front of the code name) to the button.
If you have created the Button fully in code. You have to specify which code to be executed on click.
[self.buttonName addTarget:self action:#selector(clickButton:) forControlEvents:UIControlEventTouchUpInside];
Here's the answer. You add new files to your project, and just for giggles, we'll call them NewViewController of the UIViewController class. Then, highlight the second view controller in the storyboard, choose identity inspector, and under Custom Class (at the top) you change the class to the name of the recently added NewViewController class. Now, all your code will connect to objects and so on. Thanks again for the help all and now I can rest in peace lol.

Binding to NSCollectionViewItem crashes Xcode

Using XCode 4.1 I've come across a crash whenever I try to use a CollectionView.
These are the steps I'm doing:
From a new project, edit the MainMenu.nib file.
Add an NSCollectionView to the window, which also adds a Collection View
Item, and a new View In the new View
Add a control like an NSTextField
Select the control, and switch the inspector to the binding pane.
Attempt to bind something to the Collection View Item.
Once the Collection View Item is selected in the dropdown menu, an
"Internal Error" dialog appears. Attempting to continue from this dialog makes the
binding pane disappear until you restart XCode
Does this happen for anyone else or is it just something I'm coming across?
Is there a way to work around it to allow me to bind to the Collection View Item (I want ultimately to bind to the representedObject value) either in XCode or in code.
I attempted to create a custom NSCollectionViewItem subclass that uses a separate nib file and set that as the itemPrototype of the NSCollectionView but things went very wrong then.
I found that splitting the collection view item view into its own XIB and then rewiring the connections so that the collection view item prototype loads the new XIB will allow for you to create the bindings in interface builder without it crashing. I followed these steps...
Delete the collection view item view from the default xib.
Create a new view and XIB inheriting from NSCollectionViewItem.
Create your collection view item in the new view.
Bind the fields to the files owner of the new view.
Back in the collection view xib, update the properties of collection view item to load the bin name of the new xib.
I'm not sure that it's quicker than doing it programmatically, but it does allow you to manage the bindings without writing code. I've got a few apps working this way now.
I've found a temporary work around:
Select the "Collection View Item" and under the "Attributes Inspector" → "View Controller" settings, set "Nib Name" to "MainMenu".
Once you've done this, it won't crash, and you can set the bindings. Be sure to clear the "Nib Name" setting when building your app.
Yup, I can confirm this bug too, even on Interface Builder 3.
The only workaround is to do the binding programmatically:
[textField bind:#"value" toObject:collectionViewItem withKeyPath:#"representedObject.foo" options:nil];

How to display "the" Assistant Editor?

https://web.archive.org/web/20110604185120/http://developer.apple.com/library/ios/documentation/iphone/conceptual/iPhone101/Articles/05_ConfiguringView.html
To add an action for the button . . .
In Xcode, select the view controller’s nib file (MyViewController.xib).
Display the Assistant editor.
Make sure Assistant displays the view controller’s header file (MyViewController.h).
Control drag from the button in the nib file to the method declaration area in the header file.
How to do step 2?
How to display "the" Assistant Editor?
It's exclusive to Xcode 4:
In Xcode 6
It is the second button with two circles.
EDIT: As of the latest version of Xcode this has changed.
In XCode 6.2 it seems they've changed the icons again. I was having trouble finding it but I didn't realize where the buttons were until the dumb old me trying to pick up iOS thought I was missing a view, so here I am posting this for any passerby who needs some visual confirmation.
To be fair, I was looking for something based of some instructions I had read that referenced the two circles, and it didn't occur to me that two circles meant a split view / assistant editor, and not until after finding this post and figuring it out did I realize a suit was a reference to a butler AKA assistant :D

Resources