Changes to MainStoryboard.storyboard no longer appear in my published app - iphone

I've been working away at a project of mine, when a couple days ago I noticed that changes I was making to the MainStoryboard.storyboard weren't occurring in the published version of my app. I tried adding new components and switching many elements and still no changes. I've tried cleaning and building, but the storyboard will still not update itself to my new changes. Changes I make to the code, however, work. I can dynamically populate a text field for example.
I feel like I've done something silly and not realized it, like somehow disconnected or duplicated the storyboard (though I only see one storyboard file in my list). I'm hoping someone has some ideas so I can progress with my project. Anyone?

I had the exact same problem and it was due to localization which splits the storyboard into different ones for each language. It remains one file but xcode shows each localization in the address bar (or whatever it is called) if you select the storyboard in the file navigator.
Most likely you made changes for a storyboard language you don't use yourself for testing.

Related

Xcode 12 does not read data from outlets, does not color code and autofill

In every project I do, I tend to have the same problem with my Xcode
I am new to swift programming learning it for about a week, but because of this problem, I can't go on with my lessons. I create a new project.
So I begin like this And basically I don't know another way to do it. Then I configure it like this which is I guess the only option. Then I add a label from the library, open the assistant, and control drag to connect it after the connection is made I cannot get to the properties of the UI element. In the identity inspector ViewController class is connected as well As it is shown here. Would you tell me what am I doing wrong? Because I am stuck. I am new to this and I know the problem must be small but I can't proceed.

Do i need to delete the storyboard in order to create an interface programatically?

Is it mandatory to delete the storyboard and it's reference from the plist in order to develop the interface of an app pure programatically or just making changes in app delegate file will be enough?
No, you don’t have to delete the storyboard file, but you should. We should never keep legacy code/files floating in our projects.
If you haven’t already, though, I’d suggest putting the project under source control. Commit the version with the storyboard. Then, when you’re done with your programmatic conversion, remove the storyboard and any references to it, and then commit that. That way, you’ve got the old storyboard stored away in source control, but not cluttering your actual project.
I found this guide: https://softauthor.com/ios-ui-design-programmatically-xcode-9-swift-4. It seems that deleting the storyboard is part of the process but I wouldn't doubt that you can simply just change the info.plist and the app delegate to ignore its presence without needing to delete it entirely.

ReactiveUI - Confused about Routing

I'm in the process of comparing MvvmCross with ReactiveUI for a major pharma project on Win Store, WP8, iOS, Droid. We've already selected Xamarin.
I'm totally new to ReactiveUI. I really like what I see in principle, and I think Paul is a genius. However the details are becoming a real bear. I've spend several days tracking down documentation (the manual is from 2011 and seems almost entirely outdated - it doesn't even contain the word "Router") and sample code.
I'm looking at the sample from ReactiveUI.Samples
Also the project MobileSample-RT from the ReactiveUI solution.
I based my little hello world on the ReactiveUI.Samples "Routing" example. Frankly this isn't much of an example as all it does is navigate from AppBootstrapper to the one and only view. I'm trying to do something similar to the "three page" example from MobileSample-RT. The problem is, if I try something like this in my project:
HostScreen.Router.Navigate.Execute(RxApp.DependencyResolver.GetService(typeof(LoginViewModel)));
It crashes (pdb symbols not loaded in ReactiveUI.dll)
If I try this:
HostScreen.Router.NavigateCommandFor<LoginViewModel>().Execute(HostScreen);
Same result - hard crash. That really threw me as it seems like something that should "just work".
I can call this:
HostScreen.Router.Navigate.Execute(new LoginViewModel(HostScreen));
And it does go to my view, as expected. I also wired up a back button in the main screen:
this.OneWayBind(AppBootstrapper, x => x.Router.NavigateBack, x => x.BackButton.Command);
And that indeed moves back from the view to which I'd just navigated.
So now I want to move forward again. I click on the button that does this (again):
HostScreen.Router.Navigate.Execute(new LoginViewModel(HostScreen));
And I go back to that view. However this time it takes 2 clicks on the back button to get actually move back. If I then move forward again, it takes 3 clicks the next time. The NavigationStack is filling up with new instances of LoginViewModel.
So, what IS the correct way to do routing/navigation? Why are those commands crashing? Rather than calling "new" each time in the Navigate.Execute, how do I navigate to a viewmodel that is already in the navigation stack (or should it be there in the first place?).
Many thanks for any clarity you can provide.
If you're building for iOS and Android, you simply don't want to use Routing - the notion of routing conflicts too much with what the platforms want you to do (even on WP8 it's a stretch but I was able to hacky make it work). You should stick with View-first location.
However, if you're using Xamarin Forms, ReactiveUI works great with VM-based routing (since Xamarin managed to do all the hacks to make it possible!). Check out https://github.com/paulcbetts/xamarinevolve2014 for a demo of it
I know the docs suck and I'm working on new ones:
https://github.com/reactiveui/ReactiveUI/pull/391 - Pull Request / Progress
https://github.com/reactiveui/ReactiveUI/tree/docs/docs/basics - Browsable version

My app is changing the way it looks

I'm pretty new to objective-c and I am working on my first app, I changed the design a little bit on it to make it look more nice and it was working fine, but then it started crashing every time i pushed a button. And now when i run it it looks like the way i had designed it before. but it still looks normal in my storyboard. This has happened to me before so i just made a new project and copy and pasted the old files and storyboard into the new one and it worked fine until now. Can anyone help me?

Unknown class in Interface Builder file

Why am I still getting this error when I run my iPhone app? The file is a ViewController that I have been working to delete and replace, but it just won't die. As far as I know, I don't have any reference (string or otherwise) to this file in my project.
I have deleted the related file (I'm trying to get rid of it.)
I have cleaned the project and rebuilt.
I have "Reset Content and Settings" in my simulator.
I have done a grep (grep -i -r "TheClassName" *) and nothing matches except my UserInterfaceState.xcuserstate file.
I have searched the code using XCode's Find/Replace tab.
I have double checked my Build Phases and am pretty sure it isn't in there (its a large project).
Any other ideas? I've spent way too many hours trying to figure this simple thing out; I must be missing something.
Thanks!
Check your nibs or storyboard, and make sure none of your views are set to the class!
I finally fixed the problem after trying it on multiple machines over the course of almost 2 days! I will not be thwarted!
I tracked the problem down to a call to setViewControllers on a UINavigationController which is called on initialization of the application. I was always being passed 3 objects (there are 3 panes in the navigation controller). Even though I had deleted the third object, as previously explained, three objects would always be passed in. The class type of the first two was correct, but the third would just be a UIViewController. Curiously, this view controller had a nibName which corresponded to the object file and Xib file that I had previously deleted. Of course, when view was called on this borked UIViewController, it would crash since the corresponding nib had obviously been deleted. Remember, the textual name of this object or Xib could not be found in my directory with grep, so I have absolutely no idea how in the world it came into existence when I ran my app.
So, I figured the app may not have been cleaned properly. I double and triple checked this. I even validated that my Workspace settings were correct (File->Project Settings->Advanced). The app was indeed being recompiled fresh every time.
Secondly, I started thinking that perhaps the object was being set by some other means. Working backwards, I added some breakpoints and found out that initWithCoder was being called on the parent UINavigationController--this was eventually working down to call the setViewControllers on the object and assigning the three view controllers (one of which was the offending one). I could easily see from the call stack that the Nib file that was being loaded was deserializing something offensive.
So, I started digging into my Xib file. Of course, the object name wasn't in the file (as expected since the grep didn't find anything). I deleted and recreated the portion of the Xib that included my root UINavigationController. This ended up changing the Object ID and ref within the Xib file.
Secondly, I created a new Xib and UIViewController with the same names as the one which I had previously deleted, hoping that Xcode might be happy if I created and then re-deleted them. I then compiled, re-deleted them, updated by Xib file yet again, reverified with grep that yes, indeed, nothing existed with that name.
And it worked. After spending multiple days on this issues, I'm fairly sure that there is a bug here in the interface builder, but do I want to revisit this problem to file a bug report? Absolutely not...
In my case, I solved an issue by name of Custom class name of View instead of Custom class of ViewController. By mistake i added like this for view as shown below.
It Should be for ViewController like this.
This is in my case, for you may be it's related with another component.
This happens when the view class is in a framework. Select the framework's module. Example with a CocoaPod: HSegmentControl.
Make sure when you add or rename or move files around especially in folders, that when you add them you:
A. Create Groups, not references they don't usually read in.
B. Check the boxes for the apporpriate "Product(s) or Target(s)" you want to add the source to.
Another thing to try :
I had to toggle "Inherit from Target" under the "Module" control of "Custom Class."