Peter Steinberger:
These seemingly innocent extensions were overriding private API. Apple’s private API detection is not super sophisticated and wasn’t triggered when the app was uploaded to the App Store. It’s also not a public symbol so there were no warnings, not even a log message. Unprefixed categories are always dangerous, especially on classes that you do not own, like UIViewController
. In PSPDFKit, we use categories for shared code, but prefix any method with pspdf_
to be absolutely sure we do not hit any name clashes. It’s certainly not pretty, and prefixes in Swift look even more alien, yet as you can see in this bug hunt, they are definitely necessary.
[…]
You can use @objc(prefix_name)
to keep the name pretty in Swift and expose a prefixed version for the ObjC runtime.
Bug Cocoa iOS Mac Objective-C Private API Programming Swift Programming Language
Chris Baraniuk (via Rosyna Keller, comments):
“We moved almost immediately after we got married so it came up practically as soon as I changed my name, buying plane tickets,” she says. When Jennifer Null tries to buy a plane ticket, she gets an error message on most websites. The site will say she has left the surname field blank and ask her to try again.
[…]
Some individuals only have a single name, not a forename and surname. Others have surnames that are just one letter. Problems with such names have been reported before. Consider also the experiences of Janice Keihanaikukauakahihulihe'ekahaunaele, a Hawaiian woman who complained that state ID cards should allow citizens to display surnames even as long as hers – which is 36 characters in total.
[…]
But McKenzie is living proof of the fact that name headaches are a relativistic problem. To many English-speaking westerners, the name “Patrick McKenzie” might not seem primed to cause errors, but where McKenzie lives – Japan – it has created all kinds of issues for him.
See also: xkcd and Explain xkcd.
Previously: Falsehoods Programmers Believe.
Bug Database Programming SQL Web
Curtis Herbert:
UIKit was written during the era of nil messaging, and I’ve come to realize it isn’t safe to 100% assume IBOutlets can’t be nil. Going forward I’ll be using optionals for my IBOutlets. I have a task in my bug tracker to scrub all my IBOutlets to covert them from implicitly unwrapped to standard optionals. A few extra question marks never hurt anyone; I’d rather my app not crash.
Update (2016-03-30): Scott Berrevoets:
Applying these three rules means you properly use the optional semantics.
Cocoa iOS iOS 9 Mac Mac OS X 10.11 El Capitan Programming Swift Programming Language
Jeff Carlson:
Apple’s screens are generally very good, but for photographers and other visual artists and designers, the inability to adjust the color profile has meant that the iPad is excluded from any serious image-processing workflows.
Now, with true color management possible on the iPad Pro, the tablet may find a place in that chain, and perhaps photographers will be able to do final adjustment work on an iPad instead of bringing a laptop.
ColorSync iOS iOS 9 iPad Pro