There’s been some discussion around the iPad’s multitasking user interface, i.e., “how to do several things at once on an iPad?”. The general feeling is…
English title, if I ever translate it: “A brief history of french/european daylight saving time policies”. Ce post reprend un thread twitter d’octobre 2016. Quitte…
1 When accessing resources from my code, I sometimes need to specify the current bundle, but the existing API isn’t great. Here’s an alternative. Apps…
If you’re familiar with Cocoa developement, you probably know what UserDefaults are. Otherwise, a quick recap: (NS)UserDefaults is the macOS/iOS/tvOS name for “user preferences”. The…
1Raise your hand if you’re an Objective-C developer and you’re sick of writing this: if([obj respondsToSelector:@selector(foo)]) { id foo = [obj foo]; } Unless you’ve…
This is the blogpost version of a talk at Cocoaheads Paris in December 20151. TL;DR: 17-second video at the end. – A few months ago,…
This is Objective-C: @interface NSArray (Map) DefineMethod(map, id (^)(id), NSArray*); DefineMethod(reduce, id (^(^)(id))(id), NSArray*); @end @interface NSString (Funcs) DefineProperty(uppercaseString, NSString*); DefineMethod(plus, NSString*, NSString*); @end int…
Apple isn’t really famous for its contributions to open source projects: its latest major effort was Mac OS forge. As the name implies, it dates…
When I started working as a software engineer ten years ago, I was tasked to write the Mac version of an existing project, and I…
In the previous post I mentioned a code pattern frequently used in tests: Run the RunLoop until something specific happens. I’ve written and rewritten this…
Here’s a subject that’s rarely discussed amond developers, even though it’s one of the most important component of all apps: Run Loops. Run loops are…
English/TL;DR The rules of french punctuation require a thin space before some marks. However, there’s no easy way to insert a thin space, so most…
A few weeks ago, I stumbled upon these private methods on NSObject: @interface NSObject (Private) -(id)_ivarDescription; -(id)_shortMethodDescription; -(id)_methodDescription; @end They can be used to obtain…
I often write small tests programs in Objective-C, to experiment stuff or play with something. Most of the time, I put everything in the main.m…
Great news Mac and iOS developers! You don’t have to upload screenshots manually to iTunes Connect anymore. There’s an Apple-provided tool to help you! It…
The Objective-C collections classes from Foundation, NSArray, NSSet and NSOrderedSet, already support various forms of functional-style programming. First, and probably oldest, is: [NSArray makeObjectPerformSelector:] Key-Value…
Yet another little objective-C hack, for when you just want to count: for (NSNumber * num in [@2 to:@4]) { // do something with num…
A few months ago, I made this cool looking View Controller animation for my app Bicyclette. I was tired of the “Horizontal Flip” animation, and…
Here’s a little experiment I made last week. It’s an alternative syntax for Key-Value Coding, which is, as you may know, one of my favorite…
I recently had to debug a complex Responder Chain-related bug: Did you know that when you send a nil-targeted action message, but there’s no first…
TL;DR: Don’t declare IBOutlets using @property (weak) anymore. Just use private ivars: ARC will take care of the rest. ## IBOutlets are, as the name…
Here’s an NSArray Category I’ve used in every single Cocoa project in the last seven years.1 What it does is quite simple, and you can…
I really, really suck at shell scripting. I don’t do it quite often, hopefully, but I’d like to write scripts in a more modern language.…
This week’s post is about a UI widget you’ve already seen dozens of time today: Please wait, I'm loading stuff. Everyone who’s used a computer…
Even with the current trend of gesture-based interfaces, every app needs a button here and there. The UIKit class for buttons is called UIButton and…
Key-Value Coding is an Objective-C mechanism for introspection and (limited) Higher Order Messaging. If you don’t already know about it, you should read the documentation,…
The best app for Vélib is growing bigger! Bicyclette 2 is almost ready, and it needs your help! Register for the beta here. It now…
In iOS apps, we write Custom Views all the time. For example, CocoaControls has a nice collection of custom views. However, it’s sometimes a tedious…
When coming from another language, strings in Objective-C are surprising on one aspect : objects of the string class, NSString are immutable : their value…
I like that name, don’t you? bou.io There’s a ton of subjects I want to write about, so hopefully this will not stay empty too…