Search Bar doesn't register input - xcode

I created a MapView and a SearchBar in a .xib file. I loaded the xib file into a ViewController was testing it in the simulator. The MapView works as it should, but the SearchBar doesn't register any input. Whatever key I press on my keyboard, the SearchBar just shows my cursor and the placeholder text. I used the SearchBar in another project to see if it works there and it does. I can type whatever I want to in there.
I don't know why it doesn't work in my loaded .xib file. Doesn't it work in .xib? I also cleaned and rebuild everything and made sure that user interaction is enabled. I enabled it in code and Xcode.
Here are my attributes for the SearchBar from Xcode. I think everything is right but maybe it helps.
Any ideas?? Thanks in advance!
Edit:
I found out that I'm not only unable to make an input, but also can't add (or see) a scope bar to the SearchBar. Again, I could add it in another project but not in this current one. No matter if the scope bar is enabled or disabled, I can't see it when I click on the SearchBar.

It turns out that I had a problem in my SceneDelegate. I still don't understand why and how this error occurred but I somehow missed this in my SceneDelegate:
this.Window = new UIWindow(scene as UIWindowScene);
If you are experiencing the same issue or want to know why, here's another question I've found with the working solution

Related

Swift 3 Xcode 8: CoreData self.managedObjectContext.hasChanges returns false

I've been following this guide.
And I ported it to my code, I have the folders being made in my library folder, the file contained is a size of "0 Bytes". Inside my tableView I am able to click and add/delete items. So it does have a connection to CoreData. However when I wish to save the results of the tableview, it steps right over the line. I put a breakpoint in and cannot see the variable (nor what I'm supposed to be looking for).
I've been trying for two days to tackle this now. I've read up on google, was using these as a reference, and still no luck. My code and bindings matches up with the sample code provided.
Reference
any ideas? things to check that I haven't already done? It does seem like a link "disappeared" but everything is all on the same viewcontroller which is what is confusing me.
Figured it out. Right Click under delegate and the saveAction will be visible. Link it to your button. Voila! nOOb mistake. Learning here!

Unable to find UIView in UIStoryboard

I'm using Xamarin.iOS in Windows. Everything is working fine except:
Sometime ago, I'd create a UIScrollView named MyScrollView inside an UIView at MyViewController.
Right now, I can use it normally programatically like:
MyScrollView.AddSubview(myButton);
The problem is:
I can't find the MyScrollView at the Storyboard Designer. I want to change some properties at the designer.
Question 1:
Is there a way to delete it and recreate since I can't find it at designer?
Question 2:
Is there a way to use a search at the .storyboard file?
EDIT:
Even if i right click over my UIView at the UIViewController, the Context menu doesn't shows the UIScrollView.
For some reason, It was created at the storyboard back-end, however it was just not showing at the Designer.
By adding the same component with the same name: MyControllerView it didn't duplicate, and assumed the original position.
Note: Special thanks to #Yuri S. It didn't solved by this answer, but i didn't know that i'm able to edit the storyboard via XML. So lesson learnt.

Xcode 6.1 Main Storyboard turned blank when clicked on Show the Version Editor button

I'm new and following a tutorial when I misclicked on the "Show the Version Editor" button instead of the Assistant Editor all my graphics I've made in the Main Storyboard is now blank! I can find them in the tree but they are "grey" or "faded", so I can't drag and drop anymore.
I guess it's just a view setting or something but I can't find how to restore it to normal?
Please help, looks like I can't post a screenshot of it since I'm new :(
Thanks
NisseB!
I fixed it myself! I just had to change the canvas size to what I had before running the Version Editor (for all iPhones) and then all the objects appeared again! If I also disabled Auto Layout I got some objects back, but in wrong locations, so this was better!

XCode 4.5.2: When editing xib file, Menu->Editor->Add Horizontal|Vertical Guide is greyed out. Why?

This occasionally happens when I'm editing xib files. On certain occasions simply clicking the associated view controller file and then clicking back on the xib file has resulted in the menu options being re-enabled. Not today however.
This behaviour/defect has been funky since the days of XCode 3, and yet I still can't google anybody who's posted a question about this or received an answer.
Thanks!
Try clicking on a control (not a view), and see if the menu items are enabled.
As #amergin said, you have to select the view on the canvas, and not in the sidebar.

How can i make a .XIB from .h and .m files?

I'm working on an existing project which I basically need to create a .XIB
so I can then put in UIToolbar and UIButtons ect.
On the App already it has a Tab bar but has been inputted through code and not the Interface Builder.
I would appreciate any guidance on my problem.
Kind Regards.
There is no automatic code that does this for you. You'll need to look in the code, find all UIView instances that need to go into the nib and manually create it. Then you'll have to be sure to set the frame of each of them to the same positioning as what is defined in the code. Finally, you'll have to be sure to remove all of that from the code (once it is fully migrated to the nib). Finally, you'll have to be sure that the components are referenced only after the nib has fully loaded (which might not have been the case in the current code).
Why not keep the components in the code (and just use nibs for new views)?

Resources