Post

Replies

Boosts

Views

Activity

iOS hardware keyboard input always uppercase
I am using UITextFieldDelegate.textField(_,shouldChangeCharactersin,replacementString) in my ViewController. I receive the correct input from my app's software keyboard. But the hardware keyboards on my iPad and my simulator both deliver uppercase characters only to my app. This won't do. Yes, I have checked the keyboards' CapsLock state. Suggestions?
1
0
1.8k
Jan ’20
App compiled for 9.3.5 crashes on older iPad
I have a newer iPad and an older iPad2. My app is written in Swift and compiled for 9.3.5, which is the OS installed on the older iPad2. ***My app runs fine in the simulator and on the newer iPad.*** On the older iPad2, a lot of mundane things work in the app, but it crashes with errors that are only semi-repeatable when I ask it to do its real work. The problem seems to have something to do with an object being garbage collected before it should be, but I am not sure that is really the problem, as the debugger sometimes gives other death messages that are completely different. Any ideas on this?
4
0
1k
Mar ’20
How to make UIAlertController modal in iOS 9.3?
How to make UIAlertController modal in iOS 9.3? The dialog box comes up, looks right and works correctly, but the app doesn't wait for an answer. I'm using #present(_,animated:,completion:) to bring it up. Even the completion block runs before the user can do anything. There is some API from versions long after 9.3 that might help if I was targeting later versions, but I'm not. I have read a bunch of articles on the net: they all say this easy, and it is easy, but it isn't modal.
3
0
1.5k
Apr ’20
iOS custom keyboard has stuff I don't want attached to it
I'm building an iPad app. I have a custom screen keyboard attached to a text field, which all works. But when it pops up, there is this other thing on top of it, containing four controls. These appear to be undo and redo arrows, copy-to-pasteboard, and a down-arrow over on the right. The down-arrow on the right makes this extra stuff go away, but not permanently. The other three controls don't seem to do anything. I don't want this stuff. I haven't figured out how to make it go away in code. I tried setting the text field's inputAccessoryView to nil. Didn't help. What is this thing? How do I make it go away? If I wanted to use it, how would I?
2
0
523
Sep ’20
Memory management on older iOS
My app is configured for iOS 9.3.5. It runs fine on newer versions of iOS. But when I run it on an actual 9.3.5 device (iPad2 from 2011) it crashes with memory management issues. In particular, when a specific class is instantiated, the allocation is visible in the stack trace and the init runs. But as soon as I put anything into its instance variables, the deinit runs on that instance and the app crashes. I put a print statement at the start of the init method. That executes just fine. The next line is where value initializations begin, and that is where the deinit is invoked behind my back. I don't know why it would do this. Do you?
2
0
397
Dec ’20
UITextView only follows links once
I use UITextView to display rtf text loaded from a file. The text has links in it. Tapping a link opens the correct page in Safari. Then I go back to my app. When I tap another link, or even the same one, nothing happens. Is there some kind of reset that I have to invoke on UITextView to make this behave correctly?
2
0
664
Dec ’20
Delete local changes in Xcode?
I imported an external project into my project by dragging its project file into mine. It didn't work. Now those files show up whenever I check something in. I don't want them and I never select them at checkin, but how do I get rid of them? I don't find them in the underlying file system, and I haven't found any controls that will get rid of them. They appear in the source control navigator under the changes tab as Local Changes.
0
0
379
Dec ’21
Animation duration won't change
I am moving layers around using UIView.animate(withDuration:,animations:,completion:). The animation works as it is supposed to, but changing the duration parameter doesn't change the duration. It always goes at the same speed. What might I be doing wrong? Is there some global thing I have to turn on for this to work?
4
0
1.1k
Jan ’22
CALayer.hitTest(CGPoint) EXC_BAD_ACCESS
In iPadOS, I'm building a tree on the screen using CALayer subclasses. Touching a visible node on the screen selects the node using CALayer.hitTest(CGPoint). This works reliably when I arrange the layers like this: But when I rearrange the same CALayer objects to look like this, after an unpredictable number of touches on the a*b composite structure, the app dies with EXC_BAD_ACCESS: Here is my code at the point of death. The LOOK HERE print statement just before invoking hitTest verifies that both layer and ksCGPoint have reasonable values. Here is the stack trace: Here is where the code actually dies in computeZ, which is called by CALayer.hitTest, which is invoked by VNode.touchesBegan, where VNode is a subclass of UIView. Does anyone know what's going on here, or how to fix it?
5
0
631
Jun ’22
NSMutableAttributedString is irrational with 𝛑 and 𝒆.
NSMutableAttributedString does strange things with 𝛑 and 𝒆. This is Unicode "Mathematical Bold Small Pi" and the 𝒆 that is near it in the Unicode table. Less exotic characters don't have this problem. Changing the attribute map of an existing NSMutableAttributedString containing these characters with some foreground colors (like white, for instance) results in a strange doubling of the character when the resulting string is rendered in a CATextLayer. It doesn't happen if the NSMutableAttributedString is created with the different map. It only happens when you use #setAttributes on an existing string. Displaying an NSMutableAttributedString containing these characters with various colors applied in a UITextField results in the strange doubling regardless of the colors involved. Furthermore, attribute ranges are thrown off by this.
2
0
552
Jul ’22
Compiler error messages disappearing
You know how XCode shows your compile errors in real time with the red ribbons to the right of the code? Now they are not there. Or they might appear occasionally after a deliberate build, but then they disappear after a few seconds, or after I click on anything. I can't write code like this. Yes, I have restarted. Didn't help. Is there some new configuration I have to set?
3
1
1.1k
Jun ’23
Backspace character ⌫ is blue
My iOS app has a custom keyboard. I recently changed the backspace key glyph from ⬅️ to ⌫. The character is blue. All keys on the keyboard are created by the same code, and no other character does this. I looked around on the web, found several complaints about blue backgrounds for things like backspace and shift keys, but nothing about the character itself being blue. The character does not appear blue when I paste it into text. Does anyone have a clue?
1
0
362
Mar ’24
Large array failure
I have a Swift project with some C code in it. The C code creates a byte array with about 600K elements. Compiling under Xcode, the compilation takes a really long time. When I try to run the code, it fails immediately upon startup. When I cut this large array out of the build, everything else works fine. Does anyone know what's going on here, and what I might do about it?
1
0
363
Apr ’24