reloadRootControllersWithNames:contexts: does not load new InterfaceControllers - ios

I have my WatchKit app (WatchOS1) set up in the following way (names have been changed to be project unspecific):
InitialInterfaceController - The main entry point of the watch app. This controller is only used to load several instances (using the same identifier repeatedly in the NSArray) of the next view using reloadRootControllersWithNames:contexts: (called from awakeWithContext:).
FirstInterfaceController - This Interface controller should be what is first displayed for the pages.
However this does not work - I get left with the blank InitialInterfaceController screen. If however I call [self presentControllerWithNames:contexts:] it works as expected, but includes the cancel button, which is not what I want.
I have seen people suggesting to use this method to dynamically create multiple page navigation scenes, but I cannot see why this doesn't work. The FirstInterfaceController's awakeWithContext: is never called.
Has anybody had this problem or is there a fix available?

Do you have the right value for the Identity in the interface controller's attribute inspector? (I have seen issues when the identity and class name are the same, make sure they are different)
Is that interface controller added to the right module in the identity inspector?

Related

How to call Method of one UI from Another UI without initializing and without making method static. - Vaadin 14

How can we call FirstUI.Java method from SecondUI.java without initializing the FirstUI.java class and without making FirstUI's method static?
FirstUI.Java has multiple tabs buttons that need to hide and show depending on what method (defined in FirstUI.java) SecondUI.java.
SecondUI.java gets loads in the VerticalLayout present in FirstUI.Java. And is added to the Vertical layout by calling the constructor of the SecondUI.java.
If I make FirstUI.Java's method static which making buttons of tabs enable/disable we have to make the tab also static (This is what happening in my case). And the whole application starts to create an issue.
Any Solution?
My code can be accessed from here, all the static methods in this classes needed to be accessed by other classes
Any Idea of how these methods can be called from different UI without making them static?
what your app needs is an event bus mechanism for between UI communication. You're trying to implement things the wrong way with Vaadin. Your original question is just a side effect of the wrong implementation.
Replied to you over email with additional info to resolve the current issues in your app.
-A

Xamarin iOS. InvalidCastException during navigation

I have a problem with the navigation of my iOS app developed using Xamarin.
On any single view in my app, when I used at least one time the back button and popped a view controller, I may have to deal with this System.InvalidCastException on my main class :
Unable to cast object of type 'App.iOS.UI.PhotoTaker.PhotoTakerViewController' (Objective-C type: 'WorkZoneSelectorViewController') to type 'App.iOS.UI.WorkZoneSelector.WorkZoneSelectorViewController'.
Additional information:
Selector: viewDidLoad
Method: App.iOS.UI.WorkZoneSelector.WorkZoneSelectorViewController:ViewDidLoad ()
In this example, I was on a PhotoTakerViewController and used a PopToRootViewController to go back succesfully to the HomeViewController (this can also happen when I use the "back" button until I'm back on the HomeViewController). Then I tried to use a segWorkZoneSelector to display a WorkZoneViewController. This is where this error appeared. So, for a reason I don't understand, the app try to cast the last view controller I have loaded to the view controller I want to display right now. PhotoTakerViewController and WorkZone inherits from a common AppViewController. None of these 3 classes have an ExportAttribute
I'm not able to reproduce this error systematically.
Something odd with this error message is also the fact that it says that the app crashed on the method WorkZoneSelectorViewController:ViewDidLoad. But when I try to add some instructions at the beginning of the method, these are never called.

How to replace content ViewController inside other View controller

I am working on an application which allows users to work with a couple of workmodes. Main view of the app contains information common to all workmodes. I want to create a "subview" with ability to change its ViewController. This subview will be used to display information connected with specified workmode. It is important that app goes to MainViewController from WorkmodesViewController in which user chooses workmode to work with.
My question is:
Which tehnique should I use to acheave changeable WorkmodeViewController inside MainViewVontroller
I have found example git project with functionality I need:
https://github.com/mluton/EmbeddedSwapping

How to properly create a storyboard in xCode6 using Interface Builder and Swift

I need help using Interface builder to create a storyboard and initial view, using xCode 6 and Swift. I do not want to start with the template "Single View Application" but with an "Empty Application" - for learning purposes.
I am starting with File->New->Application in xCode 6.
In the left pane I have selected iOS-> Application and I am choosing the template "Empty Application"
So now, I have my empty application and I want to use Interface Builder to create a story board.
I select File-New-File - then in the left pane I select iOS-User Interface and in the right pane I select Storyboard. I call my storyboard "Main"
That seems to do nothing, so then upon examining other templates, I decided that I need to go to info.plist and add a key/value pair, and so in info.plist I added a key "Main storyboard file base name" and a value of "Main"
After that I get the error:
Failed to instantiate the default view controller for UIMainStoryboardFile 'Main' - perhaps the designated entry point is not set?
So now I go to the story board and drag and drop a "View Controller" onto the storyboard, and btw - in the View controller inspector it is checked "initial scene - Is Initial View Controller"
But this doesn't create any swift file - which may be expected, but just to be clear it doesn't. Now when I try to run, I get the error:
Application windows are expected to have a root view controller at the end of application launch
So any ideas? I am trying to figure out how you properly use Interface Builder to create a storyboard and initial view and do a basic hello world, without skipping past the use of the tool to have it created for me in a template, because my assumption is you will quickly have more complex apps than can be created from a template, and it might be good to know how to use the tools - but I am not finding documentation on the subject.
Edit: strange timing I happened to find the answer just as someone else had also correctly answered the issue for me, so I will edit this post and remove the answer - as the answer below is exactly correct.
The storyboard automatically creates the window and instantiates the initial view controller for you. The code in the app delegate is creating another window which you don't want. You should delete all the code in didFinishLaunchingWithOptions, except for "return true". It will then run properly.

Failed to instantiate the default view controller for UIMainStoryboardFile 'Main'

I am trying to create a new Swift project and am having some issues. I tried to create a new single page application but when I build I get an error saying:
2014-06-07 11:04:13.752 Matchismo (Swift)[2007:598021] Failed to instantiate
the default view controller for UIMainStoryboardFile 'Main' - perhaps the
designated entry point is not set?
But when I create the same single page application project with Objective-C as the language, it compiles and runs just fine. Is there some manual thing I must do in Swift to get a project up and running?
My understanding for this error is that I need the default view to be set, which is merely checking a box on your view controller's attributes (picture below). I tried the solution suggested in this stackoverflow post but it didnt help and I can't find much more help on the subject with Swift being so new. Any suggestions are appreciated.
Select the ViewController Scene. Now, select the inspector panel from the sidebar options. Check the “Is Initial View Controller” attribute option, save the project and build the project again.
Some times it doesn't take the initial view controller.Just create a new storyboard with anyname you want and set that name into the interface in your application setting.
Copy paste the code from previous storyboard and run the app.
The application will run fine.
Dont forget tocheck the initial scene in storyboard.
By following the below steps, it would work fine:
Select the Scene which is the type of ViewController/UICollectionViewController in Main.storyboard.
Select the Attribute Inspector in the right sidebar.
Click/Check the “Is Initial View Controller” attribute.
Re-Run of the project and this should solve the issue.

Resources