Ad

Our DNA is written in Swift
Jump

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"
                                  size:20];
   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

Xcode Coverage

Code Coverage is described on Wikipedia as:

… a measure used to describe the degree to which the source code of a program is tested by a particular test suite. A program with high code coverage has been more thoroughly tested and has a lower chance of containing software bugs than a program with low code coverage.

Less bugs? Yes, please!

Read more

TopLayoutGuide 97 Pixels?!

When implementing iOS 7 support for a client’s app I got a result that might stump even seasoned Cocoa programmers.

On iOS 7 views generally go behind translucent bars. To still get your views aligned correctly – when creating them in code – you have to get the responsible view controller’s top and bottom layout guides.

Those get set sometime before viewWillLayoutSubviews and I found it useful to add a viewInset property to the view controller’s base view. Setting this would setNeedsLayout and then you can rearrange the subviews according to the new insets in layoutSubviews.

Read more

Radar: Xcode 5 unable to configure inline Unit Tests for iOS and Mac in parallel

The following issue is a head scratcher if you are trying to add unit tests to your project that both run on Mac and iOS. And if you like to use the new inline buttons for executing individual tests.

Filed as rdar://15085316 and Open Radar. The mentioned sample project is the UnitTestTest sample on our Radar Samples GitHub repo.

Read more

Radar: Device shuts down even though 19% battery left

I’m seeing this issue on my main phone after having begun to use the iOS 7 GM on it.

Filed as rdar://15056186 and on Open Radar.

Read more

DTCoreText 1.6.7

Following the public availability of iOS 7 and having collected a good amount of fixes, I felt that it is a good time to release the next maintenance update to DTCoreText.

Read more