Recap of Tonight's Section | Material for Next Week

0 views
Skip to first unread message

John Trupiano

unread,
Aug 20, 2009, 9:00:57 PM8/20/09
to bmore-...@googlegroups.com
Hey guys,

We had a great session today reviewing lectures 1-3 from the Stanford course.  We spent a good amount of time sharing pointers/shortcuts for working within Xcode, and we worked through assignment 1B in pairs.

For next week we're going to review lectures 4 and 5 and complete assignments 2 and 3 (which continue off of assignment 1).

If you're entirely new to the platform and want to get started, this is probably your last chance to catch up.  If you're already familiar with Cocoa, then now would be a perfectly good time to jump in.  We've got plenty of momentum now as a group.

-John

Paul Barry

unread,
Aug 20, 2009, 10:08:34 PM8/20/09
to bmore-...@googlegroups.com
Yeah, great meeting tonight, we had a nice turn out of 7 people, a good mix of people with some experience with Cocoa/iPhone Development as well as smart people who are new to it an picking it up fast. 

I'll be out of town the next two weeks, but I'll watch the videos and do the assignments.

One thing we discussed was that we don't know of any particularly good unit testing frameworks for iPhone development yet, but one great tool is scan build.  Here's how to use it:

$ cd src
$ curl -O http://checker.minormatter.com/checker-0.215.tar.bz2
$ bunzip2 checker-0.215.tar.bz2
$ tar xf checker-0.215.tar
$ ln -s ~/src/checker-0.215/scan-build ~/bin/scan-build

That last command assumes you have ~/bin in your path, you could also do "sudo ln -s checker-0.215/scan-build /usr/bin/scan-build" if you like.  Next, go into the directory than contains the .xcodeproj directory for your iPhone app:

$ cd ~/Development/study/Objective-C/CS193P/Lecture1/Assignment1A/HelloStanford
$ xcodebuild clean

That last command is the same as running "Build > Clean" in XCode.  Now you can run scan build:

$ scan-build -k -V xcodebuild -configuration Debug -sdk iphonesimulator3.0

If that errors about saying The identity 'Whatever' doesn't match blah blah blah, you need to go to Project > Edit Project Settings and set it to not try to code sign.  See this URL for more info:

http://www.oiledmachine.com/posts/2009/01/06/using-the-llvm-clang-static-analyzer-for-iphone-apps.html

If it says BUILD SUCCEEDED, congrats, your have no memory management issues!  Just for fun though, go into your code, alloc something and then don't release it.  When you re-run scan build, you should see it open the report in your browser and show you the problem.

I've attached a screen shot of what the error looks like in the report.  A very valuable tool as you work on larger projects.
scan-build.png
Reply all
Reply to author
Forward
0 new messages