Archive for November 9, 2016

Wednesday, November 9, 2016

NSItemProvider’s NSSecureCoding Reflection

Apple on NSItemProvider.loadItem(forTypeIdentifier:options:completionHandler:):

Call this method when you want to retrieve the item provider’s data. If the item provider object is able to provide data in the requested type, it does so and asynchronously executes your completionHandler block with the results. The block may be executed on a background thread.

The type information for the first parameter of your completionHandler block should be set to the class of the expected type. For example, when requesting text data, you might set the type of the first parameter to NSString or NSAttributedString. An item provider can perform simple type conversions of the data to the class you specify, such as from NSURL to NSData or FileWrapper, or from NSData to UIImage (in iOS) or NSImage (in macOS).

Douglas Hill (via Twitter):

This API makes use of reflection internally: it looks at the type of the block’s first parameter to decide what to return. This is dependent on Objective-C’s looser enforcement of the block signature compared to Swift — and therefore does not work in Swift. (Yes, still.) See this discussion on the developer forums.


It’s strange to me that Apple would write such a recent API in such a bizarre way - as far as I know, there is no documented way to reflect block signatures so its fragile anyway. Why not just take a class parameter and give the block an id parameter type?

It’s a strange API.

What’s Wrong With Git? A Conceptual Design Analysis

Adrian Colyer on a paper by Santiago Perez De Rosso and Daniel Jackson (Hacker News):

The authors chose to use Git to explore the role of concepts in design – it is widely known and used, and at the same time known to be confusing and difficult to learn. Are the usability problems of git just on the surface, in the expression of the commands, or do they run deeper?


The staged and working versions of a file are coupled in complex ways, and Git commands that one might expect to affect only one often affect the other too. One way to get into trouble is to add a file, then continue working on it before committing. If you then decide to undo the commit with a reset command then depending on the arguments not just the staged version but also the working version will be replaced (wiping out subsequent work since the commit).


It’s rather weird to see the model described as such, since the underlying git model, the one that makes everything make sense it’s not even mentioned. It stays only one the surface of the command line interface, on the “porcelain” never touching the plumbing which is quite straightforward. In essence git is a layered system.

Martin Winter:

While I understand that removing the concept of staging makes things simpler to understand, I consider the staging area/index to be one of the most useful features of Git. I often make extensive changes to multiple files, which I do not want to save in a single, monolithic commit. I use the staging area to assemble fine-grained commits by carefully picking files and even individual lines. I can imagine that this could be solved without the index, but it seems a very useful concept still (like a safety net in some sense).

I like staging—don’t understand people’s issues with it. To me, Git’s model is good, but its interface could be improved.

Miyamoto Spills Donkey Kong’s Darkest Secrets

Chris Kohler:

It’s long been known that the game’s protagonist was named “Mr. Video” and “Jumpman” by Miyamoto, but that it was Nintendo’s American branch that christened him “Mario” due to his resemblance to their landlord, Mario Segale. But did you know that Donkey Kong was supposed to have human voice samples? Or that Nintendo had a company bathtub?


Miyamoto had to create Donkey Kong under intense time pressure. Nintendo of America was sitting on many unsold cabinets of a failed arcade game called Radarscope, and it needed a replacement game immediately. Miyamoto knew he was going into intense crunch time, and telephoned several of his friends, saying, “You probably won’t hear from me for about two or three months.” This was about how long it took to create a full game in those days, he said—but in fact, Donkey Kong ended up taking about four or five months.


“For example, for the game’s title, I was trying to convey the idea of ‘stupid monkey,’” he said. “‘Donkey’ of course referred to the animal, but the dictionary I used said that it had a secondary meaning of ‘idiot.’ Nintendo of America said that this was not the case, and ‘donkey’ didn’t mean ‘idiot.’”

Replacing Dropbox With iCloud Drive

Collin Donnell:

Apple’s strategy has been to present everything as though nothing will ever go wrong with any of their software or services, and so the user doesn’t need a lot of tools to help recover when something does. Because it won’t. Ever.

All of Apple’s services just feel opaque. iCloud drive isn’t great as far as letting me know the status of my documents. If it did break in some horrible way, I have no trust that I would have a good way to get my stuff back.


The strange feeling I have is that I’m not moving because iCloud Drive has gotten better than Dropbox, or even that it’s gotten as good. I’m moving because maybe it’s become sufficient for my needs. I’m purposefully not using what’s clearly the best thing on the market, because I think I’m willing to live without some of it’s features. Hopefully it’ll be good enough.

Chris Dzombak:

February 2015, I put 1000 small text files in an iCloud Drive folder. Today, there are 999 left.

I do not trust this system.

UPDATE: 14.txt has been located, in iCloud’s (very well-hidden) Restore Files UI. I have no idea how it was deleted.

Previously: Dropbox Modifies TCC.db to Give Itself Accessibility Access.

Update (2016-11-09): Arthur A. Sabintsev:

Did this last month - haven’t had problems.