Apple Programming

Everything that I wrote about my programming adventures. There are some very old iOS projects that are definitely obsolete in what concerns the features and functionalities but not in what regards the code. Most Objective-C code is valid even today, although Swift is a much modern and flexible language.

Error opening serial port

Encouraged by the latest developments, today I started building a new application that will  allow remote connection to Kenwood TH-D74, remote control and APRS data transfer. However, while building and running the app I got the following error: If you encounter this, be aware that it is generated by application sandboxing. You can think of using […]

TH-D74 BLE or “Bluetooth Low Energy”

Struggling to understand how Universal Unique IDs work (see here) I was wrongly assuming that Core Bluetooth is a framework from Apple that covers all aspects of communication with devices via BT. I was WRONG ! scanForPeripheralsWithServices method and, in general, what I tried to do, for almost a week, is NOT good for my intended […]

Using UUIDs and Bluetooth

I did some more steps towards accessing Kenwood TH-D74’s services via bluetooth. I struggled for some time understanding how discovery based on UUIDs work. I was not aware that, for each service profile, there is a standard Universally Unique Identifier (UUID) documented in Bluetooth SIG specs. Specifically for Serial Port Profile (SPP) service, the UUID […]

Why unsupported central manager state ?

Several days ago I received a Kenwood TH D74 portable transceiver. Although I have a Yaesu FT60 and some other smaller and unimportant transceivers, I don’t have any transceiver that is APRS capable. What’s more important, this transceiver is BT and USB capable, providing serial communication, which opens some interesting opportunities. Today I opened XCode […]

Abandoned Posts

Over the past seven years (the age of this blog) I started writing several articles that I never  finished. It’s time to trash them completely or just add them to a list for future afterthoughts. Who knows ? So, from older to newer: “Weller WD 1000 M Review – Part III – Software”, January 18, 2013 — […]

Things to do, drafts and timeline

Today, while I went over all my posts, I noticed that I have a large list of 43 draft posts. These are articles that I started writing, thought to be interesting, but I had limited bandwidth to finish. I need some planning with these, thus I put them down, maybe getting some input from you […]

Some thoughts on the Responder Chain

I had a lot to do these days and did not manage to keep up with the blog. Very busy time at the office before Christmas. Luckily, I’ll get my vacation soon by I swear I will not spend it on much anything else than reading paper books. And books which are not about programming, […]

XCode 5 LLDB Debug Assertions

One situation when a debugger might not be the first option is when you are not sure where does a program has a bug. One way you can check whether your assumptions are truly what is happening in your code is by using assertions. What assertions let you do is express one particular assumption and […]

Data Tips and Quick Look — debug console display

XCode 6 — new debugging features

As one of the goodies launched during current WWDC 2013, Apple has released a developer preview of Xcode 5 and detailed some of the new features it offers such as Automatic Configuration, Test Navigator, Bots, Auto Layout, Asset Management, Debug Gauges, Source Control, and more. Looking over some of the videos of the WWDC Sessions Videos, […]

Writing serial drivers for OS X (1)

At least one thing can be improved on Mac Dev Center: the code sample repository. I am not talking about documentation. In this particular case, there’s not much new to write about. The I/O Kit documentation (grab the pdf while it is stil there) is sufficient. On the shelves are tons on books about C and […]

Simple stuff: viewDidLoad vs. viewWillAppear

I was coding today for a small project I have. A very simple iOS application that has a very simple storyboard, two different paradigms for iPhone and iPad, but very, very simple. While coding I was struck by the fact — frequently forgotten — that we tend to ignore the obvious. Ok, here’s the deal: take one […]

“Auto Layout on iOS Versions prior to 6.0”

A short reminder, because I ran into this today and Xcode’s very poor at providing you useful verbosity when debugging Auto-Layout stuff done in Interface Builder. Sometimes (Xcode 4.x and 5.x) you might get the following errors when building an iOS project: Going to each error does not help much. Debugging IB auto-layout errors is […]

Writing a (working) USB driver for OS X

For some time I was struggling with an ambitious project, to write a Mac driver for my Agilent DSO-X 2002A oscilloscope (see here). The reason behind this is SCPI and the opportunity to reach fresh perspectives in computer–measurement instruments’ integration. However, it was not an easy way. More of a reverse–engineering project, was very time–consuming […]

Simple and default UIPickerView

UIPickerView Tutorial — part 2

Before we continue the second installment in the series of basic tutorials about UIPickerView usage and customization, a short digression. Most Cocoa/ Cocoa Touch tutorials assume that all connections to delegates, data sources and outlets are done visually in XCode. Our previous example was no exception. You can see from the project (gave the link below) […]

Simple and default UIPickerView

iOS 7 UIPickerView Simple Application

Recently I was asked by a friend to provide some support with UIPickerView in iOS 7. He was a bit puzzled by what it seemed to be the impossibility to pad the content of each picker view row to a certain distance from the left side of the UIPickerView. Basically, let’s consider the following example. […]

Auto-increment versioning in XCode 5

Ok, this will be quick. There is no built-in feature or that supports automatic code versioning in XCode. I am talking about auto incrementing versions or build numbers in XCode plist, aka “CFBundleVersion” info.plist entry. Here’s a quick one for XCode 5. Make sure your target has an *Info.plist file. Add an entry there, as […]

Using LLDB Commands in XCode 4

The rationale for Apple’s move to LLVM and slowly parting with the aging GCC has a long history and is out of the scope of this brief tutorial on LLVM commands. The primary reason for switching from GCC to Clang — probably — is the incompatibility of GCC’s GPL v3 license with the goals of […]

NSString initWithBytes:length:encoding:

NSString initWithBytes:length:encoding instance method. A quick example. Uses a NSData object from the content of my blog’s first page and displays the string in an NSTextView outlet: The result: A variant, with a char array: The result:

Chasing Zombies in XCode 4

Ok, this will be a short one. Probably I will create a category like “code snippets and hints” to include all these small articles. This is about zombies in your coding projects and how to chase them. Enabling a project to trace zombies is different in XCode 4 than in previous versions. There is a […]

Core Animation documentation revisited

January brings updated documentation from Apple and I want to share the link to the  completely rewritten Core Animation Programming Guide. The release notes include reference to a “Major revamp, reorganization, and expansion to cover modern Core Animation behavior in iOS and OS X”. Just in time, as some of my projects rely on this. […]

NSOutlineView — Inside Out 2

Some good months ago I started a series on NSOutlineView that I didn’t imagine it will stir such an interest. To my astonishment, googling NSOutlineView ranks my post fourth in the search, immediately after Apple’s official documentation and some other two links: This intriguing situation (nevertheless inspiring for me) might have to do with the […]

XCode 4.3.3 – how to edit build settings

Working on my Logic Analyzer project, I wanted to setup a combined target structure in XCode, to have the complete E2E scenario built, from μC firmware to the cocoa libraries and application code. This means adding custom targets for μC build and upload. Well, as a short reminder, for now I am using a simple Arduino […]

Logic Analyzer!

…and not only software (maybe). OK, to keep things short, I got tired by limitations of my Saleae logic analyzer, especially on the software side so I decided to build one. This is my new project: a DIY logic analyzer that I will hopefully use to better extent in my other projects. First results promising. […]

NSOutlineView — Inside Out

This is the first part of a series I intend to maintain on NSOutlineView. Some NSOutlineView basics and a very simple example.

Micro Project IDE - general IDE preferences - colors

Going Low Level

Some time ago I have on boarded on a very ambitious project that I though could be overkill, nevertheless I have persevered in my ambition to prove it is doable. However, as I needed to dig a bit into Assembly language, I have gathered some resources I thought it might be useful to share here.

RFM12B Command Calculator for Mac

RFM12B Command Calculator for Mac

Inspired by this project for RFMB12 and needing a similar one for my Mac, I started to build one myself: Next – a version for iPad. Stay tuned. 😉

Keyboard shortcuts in XCode 4

First things first. Let’s present the navigator shortcuts. The Workspace Window has the following for areas: Opened with all areas active: Pressing cmd + 0 hides Project Navigator (left area): Pressing opt + cmd + 0 hides Utilities Area (right area): Pressing shift + cmd + Y hides Debug Area (bottom area). Always useful to […]

Globals and Singletons

My preferred approach to creation and maintaing global variables/ constants is by singletons and singleton instance[s]. Not only is an elegant method that adds compliance to a very important Cocoa design pattern, but also provides you a lot of flexibility.