Mac OS X, Programming

OpenMP Clang in Xcode

I’ve been playing around with prime numbers recently, which (naturally?) extended into an investigation into parallel programming. I installed the latest version of GCC 5 (v5.3.0 at the time of writing) using these instructions and got OpenMP running (support is built-in). I’m fine with using Terminal but I thought it would be interesting to try […]

iOS, Programming

UITextView Padding

If you align a UITextView with another element, particularly a UILabel, using Auto Layout you will notice the text in the UITextView is slightly indented. The UITextView is actually implemented inside an NSTextContainer which has some padding around it. To remove this (left/right) padding, set the following property of the UITextView to zero: textView.textContainer.lineFragmentPadding = 0

iOS, Programming

Embedded Content Contains Swift Code

Ran into this error today: dyld: Library not loaded: @rpath/libswiftCore.dylib It was solved by changing the Build Option: Embedded Content Contains Swift Code to Yes The project in question was Objective-C based but had an embedded project (Charts) written in Swift.

iOS, Programming

Encoding a URL in iOS 9

The typical way to encode URLs (e.g. turn spaces into %20) was to use NSString’s stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding As you may have noticed, that method has been deprecated in iOS 9. You now need to use stringByAddingPercentEncodingWithAllowedCharacters:NSCharacterSet which takes an NSCharacterSet as it’s argument. What NSCharacterSet am I supposed to use you may ask. I recently ran into

iOS, Mac OS X, Programming

Ctrl-drag to Create Outlets in Custom Views

If anyone can tell me why Xcode (I’m using Xcode 7 beta 5) works this way, I’d greatly appreciate. I have created custom table view cells in the past and I’ve always control-dragged from my storyboard into the custom class to create the outlets. So, when I went to create outlets for a custom (ui)view

Programming

WordPress Menu Button on Mobile

A quick note regarding WordPress and its Menu button on mobile devices (mobile Safari for sure, others possibly). I’ve been trying to update this site a little and added a Books page to highlight the book I’m currently reading, along with books I’ve read over the last year. I decided to track the books using

iOS, Programming

Gesture Recognizers in iOS 9

I don’t code nearly as much as I’d like to, so keeping up-to-date is always a major challenge. I’m still trying to get up to speed on all the great iOS 8 updates with iOS 9 is right around the corner. So, this is probably not news to you but it was news to me. Prior

iOS, Programming

Creating a Transparent Modal UIViewController in iOS 8

I’ve just started to scratch the surface of all the cool things iOS 8 can do, so much to learn! One of my apps presents a modal view controller that asks the user to select a date from a custom calendar view I built. The app displays photos and this modal vc is presented over an

iOS, Programming

How To Convert HTML to NSAttributedString

I’m not sure what the best practice is these days when displaying HTML content in your app. It seems you can either put it into a UIWebView or you can, as of iOS 7, convert it to an NSAttributedString and put it into a UILabel, UITextField, etc. I have been leaning toward the latter recently and

iOS, Programming

How to Convert an ISO8601 Date in iOS

I still find working with dates in iOS a little tricky. There is always a new format to deal with and it’s all about getting the identifiers for the format just right! I recently ran into ISO8601 and hope the bit of code below is of some use. NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@”yyyy-MM-dd’T’HH:mm:ssZZZZZ”];

Scroll to Top