Good code should be self-documenting, but sometimes you also need to generate external documentation for reference purposes. In this post I’ll show you how to use two open-source tools and a build script to create beautiful, Apple-style HTML documentation files in Xcode. I’ll also show you how to create docsets for Xcode so that your class references show up right along side Apple’s! It will be a seamless and dare I say, enjoyable, process for generating documentation.
iOS 7 finally launched on September 18, and with it, the public release of Xcode 5. However, after upgrading you will notice that you can no longer compile using the iOS 6.1 base SDK. This is a problem for any app that isn’t yet compatible with the iOS 7 SDK. To see what SDK’s you have installed, open the Terminal app on your Mac and enter:
If you only see the iOS7 SDK folder listed, you will need to extract the iOS6 SDK folder from an old copy of Xcode 4.6. Or you can just download it here. Copy your extracted iPhoneOS6.1.sdk folder into the folder shown above. Shut down and restart Xcode. You will then be able to select from both SDK’s when building or running.
If you just need to download the iOS 6 simulator, open Xcode and go to Xcode > Preferences > Downloads.
A common use case in iOS is creating a form or an editable list of records directly inside a UITableView. We could send the user to a separate “detail” view controller for editing, but that complicates and slows down the user experience. In this post, I’ll show you how to create your own subclass of UITableViewController that can support any number of UITextFields inside your table cells and use them to update any backing data source. This code can then be reused in any project that needs an editable table view!
With all the high-level languages in widespread use today, it is often easy to forget that at the end of the day, everything boils down to binary: ones and zeroes. This is shielded from us via multiple layers of abstraction. There is nothing wrong with using these abstractions; they have made great modern-day development possible. At the same time, they conceal some of the more intriguing quirks that are inherent in the binary system. This includes bitwise operations, and specifically an operation called a bitwise swap. This is a very efficient operation that can exchange the values of two variables of the same type without using an intermediary variable, and looks like this in C:
In Objective-C and other C-based languages, pointers are declared using the asterisk character. So, to declare a pointer to a UIView object called foo, in most examples and documentation you will see:
Ah, pointers. Nothing strikes more fear into the heart of novice C programmers, or developers who aren’t used to them. Add to that the notion of double pointers (**) and address-of operators (&) and you are pretty much guaranteed to scare them away. But they are really not that hard, as long as you understand 3 things:
Most developers are familiar with the concept of N-Tier Architecture. It is a software pattern that separates components of an application into separate logical layers to establish code boundaries, promote flexibility, and allow reuse. Most commonly this is accomplished using 3 layers:
Posted in .NET, Design, iOS, Software Development
Tags: 3-tier, abstraction, BLL, Business Logic, controller, DAL, fat, n-tier, presentation, thick, thin, UI
Most object-oriented developers are familiar with static methods and classes. They are present in most programming languages including C# and Objective-C (where they are known as class methods). Here are some common cases in which they are used: Continue reading
Posted in Computer Science, Software Development
Tags: class, class method, method, object oriented, OOP, pop, procedural, static, static class, static method, unit test
Leave a comment
Last night I attended the inaugural meetup of the Great Agile Companies of NYC group at AppNexus‘ beautiful headquarters in New York. The event was moderated by Josh Grob, a member of AppNexus’ Agile Strategy & Execution team, with the intent of open-sourcing the definition for what it means to be a great Agile company. AppNexus’s own Agile team is less than a year old and has quickly grown to 11 full-time scrum masters. With over 500 developers building the company’s flagship online ad auctioning platform, the need for a dynamic and scalable software development process has never been stronger.