Sunday, January 1, 2012

iOS SDK Development - new Book

I was taking a class on how to communicate between iOS app and a Ruby on Rails server using JSON when a new book was released (beta) by Pragmatic Programmer.  The book, iOS SDK Development by Chris Adamson and Bill Dudney is spot on for me right now.

I had been taking a cram class from Mattt Thompson that covered this topic but was still emphasized manual memory management and non-storyboard techniques.  Both valuable things to know but Adamson and Dudney's book used ARC and Storyboards and even covers JSON using the new support in iOS 5.   I have to really hustle to keep up with Mattt covering a lot of material in just 3 Saturday sessions of 6 hours each.  That has given me a good base to move ahead.  iOS SDK Development is exactly what I need to fill in some of the blanks and to make the full transition to iOS 5 features.

 

Friday, December 2, 2011

Sample Application

Just completed chapter 3 of Hartl's Raills Tutorial.  Only real change is adding haml to the mix. While haml does not seem to be officially part of Rails 3.1 I thought this would be a good time to add.

Chapter 3 is just about mostly static pages and adding rspec and autotest.

Code pushed to github.

Gemfile:

source 'http://rubygems.org'

gem 'rails', '3.1.3'

gem 'sqlite3'

gem 'haml', '~>3.1.4'

# Gems used only for assets and not required
# in production environments by default.
group :assets do
gem 'sass-rails', '~> 3.1.5'
gem 'coffee-rails', '~> 3.1.1'
gem 'uglifier', '>= 1.0.3'
end

group :development do
gem 'rspec-rails', '2.7.0'
end

group :test do
gem 'rspec-rails', '2.7.0'
gem 'webrat', '0.7.3'
gem 'spork', '0.9.0.rc9'
end

gem 'jquery-rails'

Tuesday, November 29, 2011

New RubyMIne EAP release

I just updated to RM-112.49 release today, November 29, 2011. It seems to be an improvement over the previous release, about 1% less CPU usage and 20 fewer threads.

Why use the EAP release? Well, it has more support for Rails 3.1.

Why use RubyMine over other editors / IDEs? This is a much harder question to answer. Let me tell you I have used just about all of the reasonable alternatives. None are perfect.  Some work faster and are more native applications.  But I like the rvm and git integration.  It also has most of the best features of other alternatives plus a lot of its own.  It is a little slower but with a really fast machine it is hardly noticeable.

Saturday, November 26, 2011

Update on Redo

Well, there have been some upgrades while I took time off to work on iOS programming and my Ruby teaching material.

RVM

$ rvm --version
rvm 1.9.2 by Wayne E. Seguin (wayneeseguin@gmail.com) [https://rvm.beginrescueend.com/]

Ruby

$ ruby --version
ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]

Rails

$ rails --version
Rails 3.1.3

RubyMine

I decided to try RubyMine 4.0 EAP instead of version 3.x.

Use the normal techniques from Hartl's tutorial to setup ruby and rails.  You just had use the appropriate version numbers when setting up Ruby and Rails.

Once everything is installed, just start up RubyMine and use Preferences to setup git and the default Ruby / Rails environment to use.

I setup a new directory for these projects and then created first_app from the tutorial using RubyMine. I did compare to hand generated version and they were the same so I am feeling comfortable with this version of RubyMine.

Thursday, November 10, 2011

iOS 5 Programming

Well, I got Hillegass and Conway's book, iOS Programming 2nd Edition for my birthday in late September.  I was having fun learning how to write applications for the iPhone and iPad. That is, I was having fun until my iPhone 4S showed up and I installed an upgrade to Xcode.

Oops.

The book was published July 2, 2011 and now, just three months later, the coding was broke.  Not totally, but enough that the authors suggested people roll back to Xcode 4.1.  Must be painful to have spent time writing a book and then have the coding environment change just three months later.

I tried lots of different ways of continuing but it was just too painful.  I thought about switching back to Xcode 4.1 and just using my old iPhone 3G (yeah, the 4S was a huge improvement) as a testbed.  But I read more info about iOS 5 and the changes and thought why put myself through learning iOS 4 then learning changes for 5.

I decided to forge ahead and learn iOS 5 from online tutorials but also use the book as a learning guide and update all the applications in it to iOS 5. So that is what I am going to do and will be blogging from time to time as I go.

Friday, November 4, 2011

Xcode 4.2 and company name

Well, I got another surprise with Xcode yesterday.  I had upgraded Xcode 4.2 to build 4D199 a few weeks ago.  I was still working on a project.  Everything seemed to be working fine, but I knew I would have some issues when I started a new iOS project because the new version included support for iOS 5.

But I got an extra surprise when the company name changed.  I had used the old standby way of setting the default company name with the command line:

defaults write com.apple.XcodePBXCustomTemplateMacroDefinitions'{ "ORGANIZATIONNAME" = "YourCompanyName" ; }'

but suddenly I was getting a different company name.

After digging around I found it was getting the name from the Address Book. What I had to do was change My Card to one that had my company name on it.  I had not updated the card for about two years so it seemed to me to be a new change in Xcode.

 

Monday, October 3, 2011

Xcode and git

If you are going to build enterprise applications you really need to use a good SCM.  I intend to look at how to integrate iOS apps within a larger application.  I have used SCM systems for more than 25 years and my current favorite is git.  I was using Hg before on a Java EE project but git has more and better tool support, IMHO.  I also love GitHub.

By default git will be used for any new Xcode project you create.  You have to uncheck the option during project creation if you don't want it. If you leave it checked Xcode will be create the default files for the project and it will do the initial commit.  After that you control the commits.  In this example I have added some code to the example in chapter 2 of Conway and Hillgras's book, iOS Programming, The Big Nerd Ranch Guide, 2nd  One way to access the git commands is via the File menu.

Xcode scm menu

Since I just added some code I want to do a simple commit. This brings up window shown below.  You can not complete the commit until you have added a comment.

XCode git commit screen

Note you can see the diffs of any file being committed.  Not a bad interface for commits.  I'll be commenting on other features of git integration as I use them.

You can also view the SCM repositories and see change history from the same File>Source Control menu.

List of Xcode Repositories