iOS 6.1.5 UITextField - text not populating - ios

My customer has a POS (Enterprise) app that was working fine on iPod6.1.3. Some of the devices were upgraded to 6.1.5 last week and began exhibiting a problem with taps on the keyboard not populating the UITextField. Unfortunately it is an intermittent problem and I do not have reliable steps to replicate, but I have seen it happen on a 6.1.5. device while running under the debugger. Here's what I know:
User taps on any of 7 UITextFields on the view. Keyboard slides up from bottom. Cursor starts blinking in the field.
User taps any key (including return). The key popover shows the key being pressed. Nothing appears in the UITextField.
Once the problem starts, it will persist until I quit the app (in this case, the app really quits with an exit(0) - required due to credit card security). Running the app again will most likely work correctly.
In the debugger, when things are working correctly I get callbacks to textFieldShouldBeginEditing:, textFieldDidEndEditing:, textFieldShouldReturn:, and textField:shouldChangeCharactersInRange:replacementString: as expected. When things don't work, I DO get callbacks for textFieldShouldBeginEditing: and textFieldDidEndEditing:, but I DO NOT get call backs for textFieldShouldReturn:, and textField:shouldChangeCharactersInRange:replacementString:. I checked the delegate for the UITextField in the shouldBegin and DidEnd methods - they are of course set to self.
Again, this behavior is new, and only in iOS6.1.5. There is nothing "fancy" going on in the view controller.
Any help would be appreciated.

Related

iOS Program Flow After InputAccessoryView

I have an unreasonable delay (3 seconds) in my iOS application between the time a user taps a control and when the keyboard is shown.
To reproduce this, I give textfield #1 focus then quickly resign the keyboard with the keyboard resign button and tap textfield #2.
If I tap between the two fields without manually resigning the keyboard I don't see this delay.
I've tried debugging the app to see the program flow but I'm not good enough with the debugger to actually trace anything, I always end up in assembler.
I know that the delay happens after textFieldShouldBeginEditing returns and after inputAccessoryView returns, but before a kUIKeyboardWillShowNotification is fired. My question is, what happens between these steps? What does the program flow look like between the call of inputAccessoryView and the notification for UIKeyboardWillShowNotification?
I believe that if I could just figure out what IOS is executing in this delay I could come up with a work-around.
I honestly believe this was an IOS 8 problem. After changing the target to 9.3 this issue seems to have all but disappeared.

Should touchID be displayed if app minimized

Im implementing touch ID to "unlock" my app, and im not sure if ive run into an apple bug or something i need to handle myself. If i tap the Home button and minimize my app before evaluatePolicy can load the Touch ID prompt, it appears over the home screen.
![not enough reputation to display screenshot, so heres a link]https://www.dropbox.com/s/zrhc60lx87ze7mt/IMG_0016.PNG
Successful/failure/cancel evaluation of this policy does nothing, but when i re-enter the app and cancel it again, touchID seems to be disabled forever until i restart the phone.
Anyone else running into this issue or have an ideas?
P.S. Theres an open radar where errSecUserCanceled is never returned from a cancel button tap, so right now i fall into my errSecAuthFailed case, which could also be the cause.
Answer is no. It should not be be displayed, when minimized.
The problem is IMHO that the code segment is being called again from your app when it goes to the background. For example loadView , didLoad and so on.
Try moving the code, that calls the authentication somewhere else in the program (different method).
For example, if your code uses a textView to enter password, you can implement the authentication within keyboardWillShow or similar.
Hope it helps.

arc4random always returns same initial value on app start

I am developing an application for the iphone that, in viewDidLoad, calls arc4random to get a random number. My problem is that each time the application starts, it gets the same number from arc4random. I ought to point out that I see this behaviour when I test the app on my iphone device and start the application from the device touchscreen. If I run the app on the device from xcode, then I see different random numbers.
Any help or advice would be appreciated. Thanks.
arc4random does not need seeding and should not be returning the same results each time you call it.
From your comments, it seems to me that your code is not being executed each time your app comes to the foreground. Remember that when you press the home button your app is not terminated by default. It will enter the background, and will resume when you tap the icon again.
If your code is inside viewDidLoad, it will only be called once which means your variable will not be updated and will contain the same value each time you inspect it. When you run from Xcode your app will be fully terminated each time and you will get the expected behaviour.
You should probably put your code in viewWillAppear: or viewDidAppear: so it is called whenever the view appears on screen, rather than once when your view initially loads.

iOS screen is constantly refreshed using UIAccessibility voiceover

I have an iOS app and I want to make it accessible. Everything goes well but in some screens the voice over loses it's focus and jumps to the first accessible element. It's like the screen is always refreshing. I have used UIAccessibilityInspector and I observed that there are ScreenChanged notifications constantly, from time to time. It's really annoying because I don't know why are those notifications sent and how do I stop/control them.
Thanks,
Alex
I had a similar problem and found that it was caused by a UIPageControl and a timer that I set up to automatically cycle the pages in that control. For some reason, the scrolling caused by that was resetting UIAccessibility to the first element in the view, just like you said. Check and see if you have anything animating or changing state.

Detecting Bluetooth Keyboard in iPad App

In my app I am having a customer info form on which there are a number of text fields I have used, now when a user edits any field I need to move whole view up so that the editing text field won't get under iPad's internal keyboard and this is working fine.
Now the client wants to use external Bluetooth keyboard for filling this form. Once this external keyboard is connected with iPad then in the app when editing any text field won't show internal keyboard as the external is connected and in this case whole view needs to be on the page and no need to move it up.
But when I edit text field it still goes up without showing internal keyboard on the screen and this leaves half of the screen blank as it moves whole view up.
For this I have tried some ways like enabling internal keyboard show/hide notifications but these notification only gets called when external keyboard is not connected and this is not helping me.
Also have tried with ExternalAccessory framework, but it wont detect the bluetooth connected keyboard also tried with EADemo to detect external keyboard and its not detecting external keyboard but it detects credit card swiper connected trough dock.
If anyone here has gone through this functionality or knows anything related with this, then please let me know.
#SpySudhir --
Logic A:
have a bool variable in some file which will return yes/no value when the keyboard is external or internal.
On the basis of the bool value returned call the animation function.
Logic B:
Listen to the keyboard notification using NSNotificationCenter.
Notifications like will,show,hide notification put an NSLog over their and see which one of them is getting called.
If external board is connected the willShow method does not gets called. so in this case can we can do some work around and set the bool value to no or we can have a counter and check it every time if its value is increased by one or is same something like this.
You should not move the view up when field gets focus - you should only move the view up as a response to a UIKeyboardDidShowNotification. The system takes care of the rest for you.

Resources