Alex Manarpies a.k.a. aceontech

How to set up in-memory unit testing for Core Data

So, you're using Core Data in your iOS app. But what about unit testing (you are testing, right)? Setting up Core Data in-memory is easy:

Read more Comments

How to configure Travis-CI for iOS projects

Travis-CI.org is hosted continuous integration for open-source projects. The service is tightly integrated with GitHub; it validates builds and runs tests as commits are pushed. Best of all, it's free (with a fair-use policy) for public repositories. Initially a Ruby-oriented service, support for more languages have been added steadily. This conveniently includes Objective-C and iOS.

Read more Comments

ReactiveCocoa By Example: UIBarButtonItem & UIButton

Listening for tap events on UIBarButtonItem and UIButton generally requires you to follow the Target-Action pattern as described by Apple. As a result, you're declaring the button in one place, and the event handler in another. The ReactiveCocoa framework includes the RACCommand class, which can be attached to any UIButton or UIBarButtonItem. Like BlocksKit, this allows the event handler to be declared as an ObjC block, thus localizing it to the button declaration.

Read more Comments

@weakify(self): A more elegant solution to weakSelf in Objective-C

The introduction of Blocks and Automatic Reference Counting in Objective-C opened the way to drastically more concise code in the iOS developer community. Apple, too, is transitioning its APIs to this new model. And while ARC solves the majority of memory issues by obsoleting manual reference counting, the use of blocks often introduces a new gotcha: issues with capturing variables. Blocks clearly need to increase variables' retain counts during execution. Most of the time, this is exactly what you want; it keeps variables around long enough. However convenient, this also comes with a caveat specifically pertaining to capturing self.

Read more Comments

More Blog Posts