Category: Apple Programming

SCPI on Mac

Some more days passed and some more finishing touches added to my MacSCPI app. It is entirely dependent on hooking the device via the USBTMC driver, but it works fine and is stable: I had some problems with buffer padding and the output it is still not 100% gibberish–free , but I assume I have to play with …

USBTMC driver for Mac

After some head banging, I finally managed to send SCPI commands from my Mac to my Agilent (Keysight) DSOX2002A. I’ve worked on this since december last year. Almost a year, but I did not spent a sustained amount of effort. I did it just during my free time. I still have a day job that …

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 …

Agilent DSO-X 2002A driver for Mac OS X

Update, October 2nd, 2014: a more recent adavancement in running SCPI on mac, can be found here. Update, December 10th, 2015: Updated terms, changed Agilent to Keysight. December again, another year passed. Traditionally, this is a month when I am taking a long break. But I was up to something in the past days and …

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) …

Split NSArray based on characters

Arrays are omnipresent. As I needed a snippet to make a string into an array of values, I thought would be helpful to share this for beginners. For example, take a string variable like, Create an array variable “array1” as:- I used the for loop to know the array1 values, which is displayed in Console …

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. …

Usage of void in C

Going into some USB programming for a project I am into (on my Mac), I ran into this and I thought would be nice and useful to elaborate a bit. This is about void* pointers and callbacks in C. USB device discovery and probing under IOKit makes heavy use of callbacks, I wanted to write …

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 …