Our DNA is written in Objective-C

DTMarkdownParser 0.1.0

My book publisher offers me two options for submitting text, Microsoft Word or an XML-based format. I’ve grown quite fond of Markdown lately and so I formed the idea that I could write my book in markdown and use a parser to create this XML from it.

And since I like to craft my own libraries (because most of the time I’m learning something in the process) I started to work on DTMarkdownParser.

Read more

BSA Banner

Writing a Book

A couple of months ago a publisher contacted me about writing a book. I have written a lot in my lifetime, blogging in general on my German-language personal blog and later on my Cocoa development blog Cocoanetics. But of course I’ve never written something spanning more than a couple of pages.

Like everybody who likes to write I’ve toyed with the idea, but not knowing about what is involved in creating a technical book I shied away from it. I was assuming that all those book authors have to take time off their normal jobs for writing. I couldn’t imagine exclusively writing for 6 months and not having time for my regular development interests.

But then there was this contact who took the time to walk me through the initial steps toward my first book contract.

Read more

Don’t Cross The Streams

Like most people I could get buy blissfully without dealing too much with Auto Layout. But there are layout-heavy scenarios where you start having the feeling that they might be much easier to solve using auto layout than by setting autoresizing masks (aka “struts and springs”).

One such example is the layout of controls in an inspector panel where I laid out the controls distanced from each other with layout constraints in Interface Builder. Architecture-wise I am using such an “inspector palette” in a DMInspectorPalette which gives me several collapsible sections. These are contained in a NSTabView (using DMTabBar as header) to get multiple inspectors laid out like in Xcode. And these are the right-most view in an NSSplitView to allow resizing of the inspector panel.

I was having some issues with that beginning with 10.9 which I’d like to document here.

Read more

-fobj-arc is not supported on platforms using the legacy runtime

The Cocoanaut asked on Twitter:

“Does anybody know what this error means? (compiled on a white MacBook with 10.7.5 and Xcode 4.6.3)”

He attached this screenshot:

-fobjc-arc not supported

I’ve been seeing this error quite often lately and so I’d like to document my answer for posteriority.

Read more

DTRichTextEditor 1.6.4

This is a maintenance update for DTRichTextEditor which includes several fixes for iOS 7. It also brings all the improvements from DTCoreText 1.6.8 into our commercial editing component.

Read more

Radar Double Feature: Xcode Crash and Unit Test with UIFont

While working on unit tests for DTCoreText I stumbled upon an issue that has two aspects, one for how you set up unit tests and the other is a crash that is new as of Xcode 5.0.1.

Consider this simple unit test:

- (void)testExample
   UIFont *font = [UIFont fontWithName:@"Helvetica"
   STAssertNotNil(font, @"font should not be nil");

I consider it esoteric knowledge that you have to have a test host in place if you want to instantiate a UIFont inside a unit test. This is why I am filing it as a bug report, since it “might lead to developer confusion”.

In the least this should be documented somewhere. You will also find a description of a minimalistic workaround for both issues.

Read more

DTCoreText 1.6.8

This update for DTCoreText is our most error-free release ever! We added tons of new unit tests and added code coverage monitoring via Coveralls. And in doing so we found a plethora of little bugs creeping around in little untested (“uncovered”) code.

Read more

DTFoundation 1.5.4

This update to to DTFoundation is a maintenance release. It adds code coverage monitoring via Coveralls and fixes some very minor issues.

Read more

BarCodeKit 1.2.0

This update to BarCodeKit establishes full compatibility for iOS and Mac. You can now use BarCodeKit to generate images of bar codes for display and print on both platforms with identical features.

Read more

Radar: Enumerating NSAttributedString Attributes on Multiple Threads causes EXC_BAD_ACCESS

This bug has been causing me grief for the last month or so, as it was hard to pin down without a concrete use case that can reliably reproduce it. GitHub user brovador finally was able to narrow it down to be able to repro it every time.

There appears to be a bug in NSAttributedString that causes an EXC_BAD_ACCESS if you try to enumerate certain attributes over a longer range on two separate attributed strings from two background threads.

I filed it as rdar://15139980 and on Open Radar. The sample is the DTCoreTextExceptionExample on our Radar Samples GitHub repo.

Read more