Inquisitive Cocoa

14th January ‘10

NSString-EscapeHTMLCharacters

Another category on NSString. This one converts a string containing characters that are special to HTML into their HTML entities.

& becomes &
< becomes &lt;
> becomes &gt;
And so on..

It’s loosely based on a similar category in the Google Toolbox. It’s written with a bias towards simplicity rather than efficiency.. and it’s on GitHub: http://github.com/inquisitiveCode/NSString-EscapeHTMLCharacters. MIT License.

Cocoa, Objective-C, SourceAdd your thoughts

27th December ‘09

NSCache is slow

Really slow according to Shark:

NSCache.png

Apparently inserting an object into NSCache is 50x slower than a regular NSMutableDictionary! I don’t know whether it’s possible that Shark might not be reporting the figures accurately.

My current work-around is to store up additions to the NSCache so that they can be inserted at a later time, when processing power is at less of a premium. Yes, shoot me. I’ve subclassed NSCache.

CocoaAdd your thoughts

I’ve no idea why it’s taken me so long to sort this one out. Especially when it’s so simple.

#! /bin/sh
#
# Opens the current file in TextMate
 
mate "%%%{PBXFilePath}%%%"

Paste into a new user script (Scripts -> Edit User Scripts…) and set the Input, Directory and Output options to 'No Input', 'Selection', and 'Discard Output' respectively and choose a useful key combination.

It’s strange how long we will struggle to work around a sub-optimal workflow, even when a fix might be disproportionately easy.

UncategorizedAdd your thoughts

14th August ‘09

As seen via gcc

5th April ‘09

Key Code Translator

3rd April ‘09

An Introduction

Categories & Tags:
By Date: