programming


iOS Programmers: Don't Use Core Data over iCloud

September 27, 2012, at 09:17:34 AM

A few people have e-mailed me and friends have asked when they will get an iPad version of Songsmith. My standard response has been, "I'm going to roll out iCloud support and universal app at the same time". 

Songsmith was written as a SQLite app so the first change in my 2.0 branch was to change the back end to Core Data and write the code to move any existing user data from SQLite to Core Data. This part went well and I did enough testing to feel confident that my code was sound. Next up, iCloud support. This is where things started to break down.

Turning off iCloud on a device for a short amount of time and turning it back on created havoc. Data was just lost. Devices would completely stop syncing. An article on Drew McCormack's website best described what was happening. It was also my first red flag.

I did something I hate doing; I started scouring the Apple Developer forums (The Mos Eisley of developer forums). Things did not look rosy. There were a lot of questions but very few answers. I was on the verge of scrapping iCloud completely. I decided to ask reddit. I listed four points of contention:

  • Core Data over iCloud works fine in an optimal situation but things like turning iCloud off and on, a device that stops syncing for a while, uninstalling and reinstalling the app, having the user delete app data can all really muck things up and cause data loss or errors while syncing. There does not seem to be a great solution for some of these issues

  • Its nearly impossible to foresee and plan for everything a user might do that could corrupt his/her database or break future syncs. At some point data loss is likely for at least a very small percentage of users

  • iCloud takes a lot of time to code and especially test. That time could be better spent adding other features to the app or making new apps (I'm not as concerned about this, I've just seen it come up multiple times)

  • Finally: Core Data over iCloud is just not ready for production yet and should be avoided


The responses were unanimous: Yup. Don't use it.

Hope is not lost, though. Document sharing over iCloud seems to be pretty stable. No transaction logs that only get sent once, no needing to wipe out local copies of files. Ray Wenderlich has written an awesome tutorial on setting it up. I am currently testing a new solution that stores data in XML plist files that use UIDocument to sync to the cloud. My test app is running great, although the performance hit of using text files is noticeable. I'm creating a small API to make using plist files over iCloud a breeze. I'll stick it on github when its good enough for an alpha release.

Also, iOS 6 is supposedly much better with Core Data over iCloud. I cannot speak to this as I did all of my testing on 5.1. As someone pointed out in the reddit thread, its a moot point because we have to support iOS 5 in the foreseeable future.

tl;dr: Don't use Core Data over iCloud. Use UIDocument over iCloud or offer your own client/server solution for multi-device data sharing. 

-troy

Posted in: programming  / Bookmark the article

Introducing THGridMenu

May 20, 2013, at 03:02:00 PM

I'm working on a new iOS project. This is the first project where I am saving myself some time and energy by implementing some cocoapods (http://cocoapods.org) for custom iOS controls.

I figured it's only fair to give back to the community. In my project, I needed a grid type menu (think of the album selection on the iPad music app) but with items that expanded depending on device rotation. I wrote a little something called THGridMenu and you can check it out on the project's GitHub page.

It's just a small thing but it turned out useful for me. It was fun to go through the process of creating a podspec. My next goal is to go through Songsmith and see if there are any of my custom classes that others might find useful.

Posted in: programming  / Bookmark the article

Things That Irk Me in Software Engineer Job Postings

July 24, 2013, at 10:32:49 AM

I'm not currently looking for a new job, but I do run across many postings through recruiters and on various blogs and aggregators such as Hacker News. Here are things that would turn me off from wanting to apply.

Use of the Word "Hacker"

I hate that word. It implies you're looking for a kid and not an adult who wants a serious career in software development. It's a desperate way of saying, "Hey look, we're hip!" While you're at it, search for "geek" and "nerd" and replace those as well.

Familiar/Cute Talk

Don't tell a cute story or make jokes or try to be amusing. When someone applies for a job they are making a huge, life-changing decision. They don't want a clever essay about the founder's life philosophy or random facts about polar bears. Explain the job and the requirements. When you write something that looks like a bad Lena Dunham blog post, you're giving the impression that your company doesn't take itself seriously. 

Casual Workplace Bragging

It appears we are in an arms race for the most casual office. "Come to work in your pajamas!" "Bring your dog!" "Drink free beer!" 

Hey, I like good perks and a casual environment as much as the next person. I love wearing t-shirts to work. Things have gone too far, though. I'd rather hear about how you're going to provide me a comfortable workspace and the equipment and software I need to do my job. I want to hear about how supportive management is. I want to hear you brag about your efficient project management procedures. 

Things you can talk about are other perks like public transportation passes, free lunches, vacation days, etc. 

These three things are basically summed up as: act professional. I don't know of any of my friends who would consider staking their professional life on a company who appears to not take itself or its employees seriously. In the reverse, ask yourself this: Do you really want to hire an employee who calls themselves a hacker geek, gets excited about pajama time, drinks on the job and spends half the day playing with the office dogs?

Posted in: programming  programming  programming  / Bookmark the article

Things That Irk Me in Software Engineer Job Postings

July 24, 2013, at 10:32:49 AM

I'm not currently looking for a new job, but I do run across many postings through recruiters and on various blogs and aggregators such as Hacker News. Here are things that would turn me off from wanting to apply.

Use of the Word "Hacker"

I hate that word. It implies you're looking for a kid and not an adult who wants a serious career in software development. It's a desperate way of saying, "Hey look, we're hip!" While you're at it, search for "geek" and "nerd" and replace those as well.

Familiar/Cute Talk

Don't tell a cute story or make jokes or try to be amusing. When someone applies for a job they are making a huge, life-changing decision. They don't want a clever essay about the founder's life philosophy or random facts about polar bears. Explain the job and the requirements. When you write something that looks like a bad Lena Dunham blog post, you're giving the impression that your company doesn't take itself seriously. 

Casual Workplace Bragging

It appears we are in an arms race for the most casual office. "Come to work in your pajamas!" "Bring your dog!" "Drink free beer!" 

Hey, I like good perks and a casual environment as much as the next person. I love wearing t-shirts to work. Things have gone too far, though. I'd rather hear about how you're going to provide me a comfortable workspace and the equipment and software I need to do my job. I want to hear about how supportive management is. I want to hear you brag about your efficient project management procedures. 

Things you can talk about are other perks like public transportation passes, free lunches, vacation days, etc. 

These three things are basically summed up as: act professional. I don't know of any of my friends who would consider staking their professional life on a company who appears to not take itself or its employees seriously. In the reverse, ask yourself this: Do you really want to hire an employee who calls themselves a hacker geek, gets excited about pajama time, drinks on the job and spends half the day playing with the office dogs?

Posted in: programming  programming  programming  / Bookmark the article

Things That Irk Me in Software Engineer Job Postings

July 24, 2013, at 10:32:49 AM

I'm not currently looking for a new job, but I do run across many postings through recruiters and on various blogs and aggregators such as Hacker News. Here are things that would turn me off from wanting to apply.

Use of the Word "Hacker"

I hate that word. It implies you're looking for a kid and not an adult who wants a serious career in software development. It's a desperate way of saying, "Hey look, we're hip!" While you're at it, search for "geek" and "nerd" and replace those as well.

Familiar/Cute Talk

Don't tell a cute story or make jokes or try to be amusing. When someone applies for a job they are making a huge, life-changing decision. They don't want a clever essay about the founder's life philosophy or random facts about polar bears. Explain the job and the requirements. When you write something that looks like a bad Lena Dunham blog post, you're giving the impression that your company doesn't take itself seriously. 

Casual Workplace Bragging

It appears we are in an arms race for the most casual office. "Come to work in your pajamas!" "Bring your dog!" "Drink free beer!" 

Hey, I like good perks and a casual environment as much as the next person. I love wearing t-shirts to work. Things have gone too far, though. I'd rather hear about how you're going to provide me a comfortable workspace and the equipment and software I need to do my job. I want to hear about how supportive management is. I want to hear you brag about your efficient project management procedures. 

Things you can talk about are other perks like public transportation passes, free lunches, vacation days, etc. 

These three things are basically summed up as: act professional. I don't know of any of my friends who would consider staking their professional life on a company who appears to not take itself or its employees seriously. In the reverse, ask yourself this: Do you really want to hire an employee who calls themselves a hacker geek, gets excited about pajama time, drinks on the job and spends half the day playing with the office dogs?

Posted in: programming  programming  programming  / Bookmark the article

The Complete iOS Developer's Style Guide

August 27, 2013, at 10:44:17 AM

The title is a lie. It is not nearly complete. The goal is to make it complete.

Okay, let me start from scratch.

I have started an Objective-C style guide specifically for iOS developers. There are a few out there, such as The NYTimes Objective-C Style Guide. The goal of this style guide is to really be a community style guide rather than one that follows the convictions of one person or organization. I'm asking for other developers to get involved and make some pull requests. Add some missing sections or correct things that I have added. The determining factor for how code should be written and organized should come from either Apple or a consensus in the community.

Eventually, as the guide becomes more complete, we can think about changing formats or hosting it in a different way. Its all up to the community.

So take a look, fork it, make some changes, etc. I look forward to what we can come up with.

The Complete iOS Developer's Style Guide (github.com)

Posted in: programming  / Bookmark the article

Introducing iosstyle.us

September 04, 2013, at 10:10:13 AM

A handful of days ago, I wrote about an Objective-C style guide project I've started, specifically for iOS developers. I have decided to give the project its own home on the web. You can find it at: http://iosstyle.us. This is hosted by GitHub Pages and is compiled with Jekyll. Any pull requests on the original GitHub project will get pushed to the website.

Take a look and submit a pull request if you'd like to add or change something.

Posted in: programming  / Bookmark the article

Back