Archive for the ‘Uncategorized’ Category

Updated version of Expenses Part 1

August 2, 2011

I have posted the update version to the first part of my tutorial on Core Data. This version of the tutorial covers Xcode 4, mostly covering the bindings portion since the prototyping tool didn’t make it into Xcode 4. You can read the post here. As a reminder I will not be adding any tutorials to this site anymore as I have moved my blog to my main development website


Blog moving

July 20, 2011

This is just a quick note to let you all know I have moved my blog to one of my domains. It is now at Now that Lion has been officially released I plan to update the tutorials for Lion & Xcode 4.1 (I should have some time next week). All of these updates will appear only on my new blog! I will add a note to each of the posts here as they get updated on the new site for the sake of those that find them through Google.

WWDC 2010 Session Breakdown

April 28, 2010

So the information for WWDC came out today (with a whopping 5 weeks notice) and it struck me, as it has many people judging by Twitter, that this year Mac OS X is the red headed step child more so than ever. To demonstrate this I went through all the sessions, of which there are 66 this year, and determined if they were just for iPhone OS, just for Mac OS X, for both, or weren’t really specified. I did this overall and by category and here are the resulting charts:

As you can see almost every session applies to iPhone OS in some way and very few apply to only Mac OS X. If this is any indication then even the sessions that apply to both OSes will mostly focus on iPhone OS. The question now is, is it really worth it for non-iPhone developers to bother going this year?

Troubleshooting tips part 1: NSLog, etc.

January 31, 2010

In the course of working on part four of the Expenses tutorial I kept getting the error about the store being incompatible with the store used to create the file despite the fact that I copied the code over from a working project. I of course started with the generic “Clean All” option, but that didn’t do me any good. As I have never had any formal programming classes (other than a year in Middle school where we had to make a flowchart for how to make a cheeseburger and wrote everything in BASIC, and I don’t mean Visual Basic, I mean late 1980’s BASIC) I don’t really understand how debuggers work, I can do some really basic stuff with the Xcode one now, but nothing of substance. After I was convinced that I had done everything right (after all I’m perfect, right?) I added a single NSLog to the start of the newly overridden method NSLog(@”configuring store.”);. Then I hit build and run, and was confronted by the lack of any statements in the log about configuring store. I was of course at once convinced that there must be something wrong in the system so I, again, did the default “Clean” thinking that would solve it, still no message in the log. I tried a different machine, still no log message. I then went hunting in the docs to see if the method had been deprecated, but it hadn’t been. In desperation I copied the method from the documentation and pasted it into my code, suddenly I had a log message and it all worked. I, of course, was confused and so looked back through the part of the tutorial with the method in it, to see if I miss a part of the method or something. It looked right… until I finally looked letter by letter and saw that I had mis-spelled coordinator by leaving out an ‘o’ the odds of me mis-spelling words is pretty high (I suck at spelling) so I should have looked for that kind of thing sooner, but I thought I had pulled from working code.
As I have been learning to write software these kinds of things have happened less often, somewhat due to experience but mostly because I have learned ways to work with my ignorance.I use NSLog all over the place to help find where things go off the tracks. I have logged each step of a method that was giving me issues before, putting in the values of variables and counts of arrays to see if what I designed to have happen actually happens. This of course means that I have to get rid of all those NSLogs at some point, or have my customer’s console fill up with crap every time they run my app (assuming, of course that I will have more than just the one small Mac app and two small iPhone apps out one day). There are several approaches out there to making this easy, I tend to go really low tech and just #define MSLOG to be either ‘NSLog’ or ‘//’ Depending on what kind of build I am doing. I haven’t used much in the way of automated defines or used scripts in my build process as of yet, but I am now starting to learn such things. So far I have a simple script that increments the build number each time (I got the basic script from a blog whose name now escapes me and altered it to work the way I wanted).
One of the other things I have started doing is keeping a notes file in each project so I can keep track of things right in the project. I am now starting to work on a way to split this notes file out of the app but in the same folder. The idea behind the notes file is that I put in more info than would normally go into a commit message, while the commit message might say something like adds feature x, the notes file will say how feature x was added so I can do it again in a different project if I want. THe notes file also gives me a place to record ideas that didn’t work so I don’t try to get a feature to work the same wrong way five different times. This is really useful for me since I tend to have multiple projects of similar idea at the same time and may go months between times I work on one of them, generally I have one that is my real project and one that is my sandbox to try ideas out. Once I get an idea to work in the sandbox I move it over to the main project using the notes file as a guide for what I need to copy and paste over and what IB connections and bindings are needed.
Let me know what you all have come up with to make your coding lives easier. As I come up with other ideas, possibly based on some of your comments, I will post about them as well.

Xcode haters

June 21, 2009

So I use TweetDeck for my twitter account (@michaelswan) and keep searches open for Xcode, Cocoa, CoreData, & Core Data. I have been noticing on the Xcode search that there are a lot of Xcode haters posting with what amounts to “Xcode sucks compared to ________.” Generally the blank is filled with Visual Studio and sometimes Eclipse. I have never used any other IDE, except a brief run in with Think C way back when I first tried to learn programming (that attempt btw failed miserably), so I really have no point of comparison. I have to wonder however is it really that Xcode is not as good as Visual Studio or Eclipse, or is it simply that now the iPhone is out and everyone is trying to get rich quick off of it (I really do think the iPhone is the modern California Gold Rush) that lots of Windows developers are coming over and can’t wrap their heads around the Mac way of thinking. As a side note before this turns into a which OS is better battle; I love the Mac OS, have never owned anything that wasn’t Mac (Classic II in 1992), and I hope to never touch a Windows machine again. That said I don’t think that Windows users are deficient in any way, they just think in a different way than me.
With this in mind I invite you all to leave comments with specific deficiencies in Xcode compared to other IDEs. You should know that I will just delete comments that just say that Xcode sucks, give me a real reason why it sucks. In the end I will try to take the comments boil them down to a consolidated list and submit an enhancement request to Apple, after all, just saying something sucks doesn’t fix it, isolate the problems and ask for them to be fixed.

Hello world!

August 7, 2008

I have no idea what I will write about here but I’m sure I will come up with lots of random topics to cover.