Exception Breakpoint fires when copying View Controller between projects - uiviewcontroller

I've customized a tutorial and am trying to import it into my project. After copying one View Controller Scene from Document Outline into my main project, it's throwing an exception without any description of the issue. The View Controller is subclassed, so I've made sure to import the associated Swift file and set it in Document Attributes.
I don't know how to troubleshoot this one.
===EDIT===
I'm at a total loss here. I created a new project and was able to import, build, and run the project. The only difference between my main project and the new one is the VC is not the initial View Controller.
The tuturial was written in XCode 11 and Swift 4. I haven't upgraded yet, but again I was able to import into a new project w/o issue.

Check the Connections inspector (the last option on the right sidebar) and make sure there are no connections with exclamation marks (!) after them.
If there are errors, check in the Identity inspector (the third option from the left on the right sidebar) if the class of the view controller is correct.
If the connections are not needed anymore (you gave the outlet a new name etc.), remove them by clicking on the X next to them.

Related

List box is not updating in Windows Phone 8

I am developing one application, in that I have 3 pages. In first page I have List Box with some data and in 3rd page I have application bar for navigating to first page. I will get the list box data from the server. Whenever I am binding the List Box with server data, it is rendering properly but if the user navigate from 3rd page to 1st page using application bar then List box is not updating with fresh data, it is still displaying old data. If user comes to first page using back key press then new data is rendering.
I am using observable collection to bind List Box data and used NavigationService.Naviagte() for navigation.
Help me to resolve this issue.
Thanks in advance.
I am not very sure about your problem because you haven't cleared the whole context. But assuming that your data is refreshing on back key press, I can suggest you use NavigationService.GoBack() instead of NavigationService.Naviagte(). The former method call is equivalent to back key press. NavigationService.Naviagte() creates another instance of the page in the memory while NavigationService.GoBack() takes you back to the previous instance. Hope this helps.
As I understand everything is fine when you start. But the update is not happening upon second return, i.e. Through navigation.
My thought is that all your code to do this is in the constructor, and since the page is not removed from memory the constructor will not be called.
Two solutions move the code to a loaded event. Simply in the constructor write this.loaded += eventname;
Or you could put code in the onnavigatedto event. Write as a new function protected override onnavigatedto.
Putting it in the navigatedto, would probably make your app less responsive if you do server calls. If you have the code in the loaded event then the information will be uploaded when it is done. Which means the user will have a moment with old information. You could then introduce a waiting screen if it is an issue.

Including projects in other projects in PHPStorm

Say I am working on a couple of PHP projects named Framework and Application, where the latter is using the former. When I dive in the Application's classes, I see some of them extending Framework's classes, for example:
class Application_Controller extends Framework_Controller
When I hover mouse over Framework_Controller and click Ctrl, I want the name to become clickable link upon clicking on which the source code of the Framework_Controller class from the Framework project will be opened.
Currently I have achieved almost the same thing by adding the Framework codebase path to the "Include path" list (having the Application project opened, go to File/Settings/PHP). The Framework codebase tree appears under "External Libraries" in the Project window. So when I click on Framework_Controller as described above the Framework_Controller class file gets opened indeed. However, PHPStorm does not take into consideration that the file actually belongs to another project named Framework — it just opens the file. This has the following disadvantages:
On the top navigation bar, the full path to the file is shown (i.e.
starting from "/") rather than starting from the Framework project
root directory.
If I want to edit the file (and possibly more related files in the Framework codebase), I would have to manually switch to the Framework project window and find the same file in there.
So I am wondering if there is any way I could tell PHPStorm that the Application project uses/includes the Framework project, so that when I click on Framework_Controller as described above, the Framework_Controller class file gets opened in the Framework project window rather than just a file external to the Application project.

InvokeAction yields App Crash

using V2.0.0.5 - beta (not via nuget but compiled source).
All through out the application I am using Multi-View over single ViewModel. On one particular view now after a conversion from SQLCE to SQLite, I am getting either a race condition or invalid contextual return when it builds up the on the InvokeAction. One thing I am noticing is a ArgumentException on System.Windows.ni.dll and well the part of the problem is the Telerik Control primitives.dll... RadTransitionControl
The only difference between this view and another with almost exactly the same build out is the way I populate the view. The view is using a "non-table" viewmodel that I built up to show some related information between 2 related tables. When I selected one of the elements in the boundlist it presents RadMenu (edit/delete) selecting edit works goes into the method expected, using the data passed in from the selection event I am able to re-hydrate the dataitem in question to respective objects. And populate the view but it dies before completing the transition from view to view.
The thing that blows my mind here is that I am using that control all over for Transistions from one view piece to another, if I change the control to ContentControl it works just fine. Other views that have that control work as expected. Any ideas?
Moving some of the code around and separating some of the bundled code resulted in this not occurring guess problem fixed...

How to fix statusbar alignment issue for iOS 6 -> iOS 7 transition?

Apple's technote here shows their recommend approach for moving content from beneath the iOS 7 status bar to below it (to avoid overlap). However, this technote seems to assume the use of storyboards. I'm wondering what to do if you have a legacy project that has a "View" in an .xib file... not even with a ViewController in the .xib. Just a view. Because you can't visually add constraints unless there is ALSO a ViewController in the .xib. But adding a ViewController results in an uncaught exception at runtime (see below).
To illustrate, rather than try to post all the sample code I think you might need to see from my project, you can duplicate the issue I'm having by launching XCode 4.6.x and choosing New Project. Choose "Single View project" in the iOS category, and uncheck "Use Storyboards".
After creating the project, click on the .xib file. Add a UIViewController so it, setting the existing view as a child of the ViewController. Select the ViewController, show Utilities, and click on the Identity Inspector. There, type in "ViewController" as your class. (So your new UIViewController uses the existing source code.)
When you run, you'll get this error:
*** Terminating app due to uncaught exception 'UIViewControllerHierarchyInconsistency', reason: 'A view can only be associated with at most one view controller at a time! View > is associated with . Clear this association before associating this view with .'
My Question: Is there any way to add a ViewController to an existing .xib file, so I can add constraints, but not get the runtime exception seen above?
(If you look at the accepted answer here, it seems the answer may be "no"?)

Referencing outlets with Tab Bar Application vs. View Based Application

Okay, so I can successfully link a UILabel in the Interface Builder to whats written in my code by dragging the blue reference line to "File's Owner" and selecting the label I referenced in my code only when using a View Based Application.
However, using the exact same code and the exact same process in a Tab Based Application (hence dragging the blue line in the interface builder to "File's Owner" in FirstView.xib) the only option that show up when connecting the UILabel to "File's Owner" is "View" rather than the other options, such as "titleLabel or albumLabel", that I wrote in my code.
Please tell me is there something I am doing wrong?
Thanks
Try control-dragging (dragging while holding ctrl key) to the actual variable definition in FirstView.h (or equivalent file).
My experience is migrating to Xcode 4 and storyboards is a much cleaner solution. Connecting outlets/view transitioning is much cleaner in storyboards instead of old interface builders.