Inquisitive Cocoa

10th April ‘12

+ imageWithPDFNamed: …

@interface UIImage (AJKImageWithPDF)
+ (UIImage *)imageWithPDFNamed:(NSString *)pdfName;
+ (UIImage *)imageWithPDFNamed:(NSString *)pdfName scale:(CGFloat)scale;

A small category for iOS to create an image from a .pdf file with as little fuss as possible: UIImage+WithPDF. It makes no attempt to cache images in any way. Realeased under the MIT License.

Cocoa, iOS, Objective-C, SourceAdd your thoughts

Here’s this mornings little productivity optimisation.. For ages I’ve had xc bound to open *.xcodeproj but that only works within the root directory of a project.. so heres a simple ruby script to open the Xcode project, either within the current working directory or within any of it’s parent directories. I have it aliased to ‘xc’ for easy triggering. Script updated to open a .xcworkspace if there is one otherwise falling back to the .xcodeproj.

Updated: 25/02/15 with the new code to favour workspaces

Ruby, Scripts, SourceAdd your thoughts

14th January ‘10


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: under the MIT License.

Cocoa, Objective-C, SourceAdd your thoughts

Categories & Tags:
By Date: