Clear button of UITextField does not appear in iOS 9 - objective-c

The clear button of UITextField gets hidden in iOS 9, it was working perfectly till now in all other iOS versions. I tried out everything from the below links :
(1). UITextField Clear Button Does Not Show
(2). How to change the tint color of the clear button on a UITextField
(3). UITextField clearButtonMode color
The button does not show up till we hover the mouse over its position.
In storyboard, I have selected "appears while editing" option and even tried "is always visible" option, but still the same.
I don't want to create custom button, so please let me know is there anything wrong in iOS 9 or what else can be done to resolve.
Waiting for a positive reply.
Thanks !!

Check the property for the specific button, textfield where you have declared, whether you had mentioned property as "Weak". If at all you have mentioned as weak please change it to "Strong".

Related

Show UITextField above Keyboard

I am using the following tutorial to show the uitextfield above the keyboard at all times:
http://mobile.tutsplus.com/tutorials/iphone/ios-sdk-keeping-content-from-underneath-the-keyboard/
But the problem is the uitextfield only gets shown above the keyboard if the person starts typing into the field, but not if the cursor is in the textfield.
How can I change it so that the uitextfield gets shown above the keyboard once the cursor is in the UITextField?
Thanks
Check UITextFieldDelegate and select appropriate method.
In this tutorial they use textFieldDidBeginEditing method to assign active textfield.
As it clear from method name, it executes when someone start typing in text field.
I downloaded the sample code and work just fine for me. The only thing that I figured you could misunderstood is in the case the keyboard it's already below the textField, in these cases the view will not scroll.
I hope this helps. If it's not this that you want, please tell me more about it.

NSTextField inside NSPopover is not key until mouse click

I've got an NSPopover that is shown from interaction with an NSStatusItem. I've blogged about the hacks I needed to do to make input even possible in this situation here: http://blog.brokenrobotllc.com/using-nspopover-with-nsstatusitem
I have an NSTextField inside the NSPopover's content view. When I open the NSPopover, the NSTextField appears as if it is key (the cursor blinks). But, when typing, nothing shows up. If I click the mouse in the field, my input starts showing up there.
I've tried things like invoking NSWindow's makeFirstResponder upon popoverDidShow:. There was no change in behavior from this. Anyone have any ideas here?
My guess is you need to make your app active; try calling
[NSApp activateIgnoringOtherApps:YES];
when you show your popover.
Edit: Of course, I could be wrong. This is all just off the top of my head.

Getting UIPicker to appear when user selects a UITextField

I have a simple UITextField called month where I get users to simply enter the month they want via the keyboard that comes up. I would now like it for them to be able to use a UIPickerDate (or UIPicker) to make this selection instead. So when they press on the text field, a mini UIPicker appears and they make there selection, press anywhere on the screen and the picker disappears.
Does anyone know how to do this or has any suggestions? I am pretty new to programming and have looked at other answers but everyone seems to be referring to this being done in a table.
Thanks in advance!
You can set the inputView property on the UITextField to be an instance of UIDatePicker. When the instance of UITextField becomes the first responder, the picker view will be displayed with the standard keyboard animation.
// Assume that self.monthTextField and self.datePicker
// are properties of the view controller class
self.monthTextField.inputView = self.datePicker;
As for dismissing, that depends on the context. If there are more text fields to populate, consider adding a UIToolbar as the inputAccessoryView of self.monthTextField. Then you can add something like a UIBarButtonItem to make the next text field the first responder, similar to how the standard keyboard provides a Next button.

Why doesn't a tap on UITextField open the keyboard?

I'm very new to Objective-C and Cocoa Touch. I have been following tutorials from a book. Currently I have a UITextField that is supposed to open the keyboard on a tap from the user to enter input.
However, when I run the app, nothing happens when I tap on the text field. I've checked all its attributes and made sure that it's enabled and user interaction is enabled.
Is there something really obvious I'm missing? I've read the tutorial two to three times, and I can't figure out what's wrong.
have you linked everything in interface builder (if you created the textfield by XIB)
Set that textfield as firstresponder. See How do I set the firstresponder?.

NSTextView wont update unless I click on it, and it wont focus. Any ideas?

I dont have time right this second to put some sample code, (Ill edit my question tomorrow and add some) but basically what happens is that I have a Window. It works fine usually, but if I use
[myWindow setStyleMask:NSBorderlessWindowMask]
to make it borderless, the NSTextView it contains will stop gaining focus even when you click on it: the ring will never appear, the cursor wont change and the scroll bar will remain gray.
Something else that happens when I make it borderless is that it wont update! I basically have this
[lyricsView setString:someString];
to update the string inside it. The Console marks me no errors, but the string wont appear in the Text View unless I click on it.
All of this stops happening if I remove the line setting the styleMask to Borderless. Any ideas? Suggestions? Comments? Cheers?
Thank You!
Kevin
From the documentation of NSWindow:
The NSWindow implementation returns YES if the window has a title bar or a resize bar, or NO otherwise.
So subclass your window and add this line
-(BOOL)canBecomeKeyWindow
{
return YES;
}