When two events happen simultaneously…

“When two events happen simultaneously pertaining to the same object of inquiry, we must always pay strict attention.”

– Agent Dale Cooper, Twin Peaks

I had a scary moment of the holiday period. I started becoming ill on Boxing day, just the usual trivial stuff – nose and throat, and by New Years Eve it had settled in good and proper. Now, I’m not someone who subscribes to Manflu and I tend to handle illness relatively well. However, by New Years Day it was well and truly getting on my proverbials…

New Years Eve had been a late night, going to bed about 4am, and then New Years Day involved going out for a walk. So by 9.30pm I was well and truly knackered – soaked in the bath and early night.

I woke at about 2am to the smell of some kind of burning. It wasn’t the smell that had woken me, it was just there. As I woke I noticed that the whole room was misty/smokey. I jumped out of bed and rushed into the kids room. I checked all the rooms upstairs – everything ok apart from the smoke.

My rationale at the moment of time was that I didn’t think there was a big roaring fire, just some kind of small simmering type fire, or more likely, something bigger outside that was filtering in through the windows.

Anyway, I rushed downstairs and systematically checked all the rooms – everything ok – except for the smoke. I looked outside, but there was nothing obvious. By the time I returned to the kitchen Victoria was there wondering what was up. She wasn’t at all panicked by some smoke, more likely by my irrational behaviour.

[Paraphrasing a strange conversation that followed…]

“What’s up?”
“The whole house is filled with smoke or mist or something,” I said.
“Go and look in the mirror,”

I looked in the mirror, and my eyes were filled with yuk! A few minutes of vigorous washing later, and everything had returned to normal.

So the smoke turned out to be my cold coming out of my eyes, or a possible reaction to the bubble bath!

The smell – Victoria had lit an incense thingy when we’d got in on New Years Day to attempt to remove the smell of the stale house.

I didn’t sleep anymore that night…

Needless to say, Victoria bought extra smoke alarms and stuff over the weekend…

Related Posts:

  • No Related Posts

Under the Sakura

Under the Sakura

Related Posts:

Apple Tech Talk

I was lucky enough to get an invite to the Apple 4k Tech Talk in London a couple of weeks ago. It was a worth while trip to the big smoke just for some of the snippets of information your get from some of the talks. Sometimes it doesn’t matter how many forums or blogs you read, how many articles or books you scour through, it takes someone talking to make something make sense.

I didn’t take copious notes like many other people did; there were a large number of people sat there typing in to their Mac Books, almost verbatim anything said!

Anyway, here are a few items I scribbled down that may be of interest.

The first two sessions I took were “Effective iPhone App Development” by Lawrence Coopet.

Data Storage
1. When storing config/session states, be careful about writing lots of objects into a dictionary as individual items. Create a session object and write that instead and don’t just write everything to NSUserDefaults.
2. Think about where you store this data… Archive and implement NSCoding and Data Recovery.
3. Use SQLite
4. Use CoreData
5. Store sensitive data in the KeyChain. This has the benefit of being able to share between projects – company data – application data.

When Caching data, make sure you place it in the correct place and never hard code your paths to this data.
All the paths are stored in NSPathUtilities.

NSTemporaryDirectory – this will always be cleared and will never be backed up.
NSCacheDirectory – this is saved, can be cleared, but will never be backed up.
NSDocumentsDirectory – never cleared, always backed up.

Choosing the right place for your data will determine how much iTunes has to backup when syncing your device.

Targetting iPhone OS
1. You should ALWAYS set your Base SDK to the most current OS version – ie. currently 3.1.2 – regardless of which OS you are considering deploying to.
2. Set you Deployment Target to the minimum OS you want your app to run on.
3. You should check for presence of OS features in your code. eg use NSClassFromString and respondsToSelector. However do this at the start of your app and set flags accordingly so that you are not taking speed hits during normal app operation. checking straight global C functions is very quick.
eg if ( UISaveVideoAtPathToSavedPhotoAlbum )

Application Flow
1. Stay focused!
2. The best system is generally – List View – Info View – Detail View. Allow the user to choose to drill down on data rather than forcing too much information on them in one go.
3. Always use the 1 screen 1 controller model.
4. Make sure you are not hardcoding references back to other objects in your application. Using the Model Controller View model your controller talks back to your model but your model should never talk directly to your controller. Your controller talks to you view but your view should never talk back to your controller. And you should never every have your view talk directly to your model. If parent communication needs to take place, then implement delegates. This way you can avoid App specific communication paths.
5. Use Delegates
6. Use Notifications through NSNotificationCentre

Memory Management
1. Make use of the measurement tools regularly – checking for leaks and generally memory usage.
2. Under Snow Leopard make use of XCode Static Analysis – it’s a fantastic tool. (BTW: It really is!)
3. Use the 1 controller 1 nib model.

Application Life Cycle
Compatibility
1. Prefix your classnames with your own token to avoid namespace collisions. eg UI, NS etc…
2. Avoid underscores at the start of method names – these are reserved to Apple.

Proper Code Paths
1. Follow correct code paths. eg. You implement drawRect and call setNeedsDisplay. NEVER call drawRect.

Interruptions
Make sure you handle applicationWillResignActive, applicationDidResumeActive, and applicationWillTerminate.

Concurrency
1. Make sure you use the Async API for Networking and Reachability.
2. Use NSTimer – don’t sit around in threads counting down!
3. Use NSOperation and NSOperationQue. Subclass NSOperation and override main.
4. Keep object access confined to one thread.
5. Design out the need to use locking/signalling/syncing
6. Avoid performSelectorInBackground and detachNewThreadSelector – if you are using these then you are doing it wrong. Use NSOperation.

Related Posts:

The Shawshank Redemption

While I was in London last week for the Apple Tech Talk, I decided to go watch The Shawshank Redemption at the Wyndham Theatre.

Most of you will be aware of the Film by Frank Darabont. Some of you may even be aware that it is based on the short story, Rita Hayworth and the Shawshank Redemption, by Stephen King.

I love the short story and I love the film. So when I noticed the other day that there was a play on in London, and that it was only running until the end of November, then I figured I should go watch it while I had the opportunity of being up there.

Firstly, I enjoyed watching it. It wasn’t great, it was ok.
I wonder if I am just not attuned to theatre. I don’t mind musical theatre, I get that, but the difference between plays and films seems to be vast. In this case, everything seems to be said in a shout.

The play is apparently based on the book and not the film – plenty of copyright issues here I guess. The problem is that Frank Darabont did a magnificent job of adapting the book, that it was always going to be hard to stray away from that. So the first think the writers did to differentiate the play from the film was to go back to the original source and have Red as a red-haired white man of Irish ethnicity – right? Wrong! Red is a Morgan Freeman wannabe… and it doesn’t work. His voice is gravelly, and fast, and loud. Morgan Freeman is controlled, slow, and soothing. I can’t read the book anymore without hearing Morgan Freeman narrating for me.

The version of Red’s voice-over, that makes the hairs stand up when delivered in the film…

There’s a con like me in every prison
in America, I guess. I’m the guy who
can get it for you. Cigarettes, a
bag of reefer if you’re partial, a
bottle of brandy to celebrate your
kid’s high school graduation. Damn
near anything, within reason.

In the play, this is the opening lines… rushed, shouted, gravelly, and disappointing…

All in all my concerns with the play were that even though the writers were apparently trying to steer clear of the film, they kept coming back to it. Many of the characters seemed liked they were poor versions of the film characters. In fact Tommy was almost identical that I wondered if they had just lifted the original actor.

In the film many of the characters we amalgamation of multiple characters – Brooks and The Warden in particular. In the play – yep you guessed it – amalgamations. Warden Norton – looked the same, if a little more portly!

I hated Andy Dufresne in the play ( Kevin Anderson). He’s cocky, too forward, almost having a controlled route through his time at the shank. But he still has this kind of Tim Robbins look-a-like thing going on.

So in the end, the play can’t make it’s mind up – be the film, be the book, or be neither. There are some very odd changes and additions that had no earthly right being there.
To be honest, I think the play is really cashing in on the film and not a decent theatrical version of the book. The writers have tried to avoid the obvious copyright issues without dropping things that their audience of film fans might take issues with. I mean, the whole thing starts with the name right? Rita Hayworth and The Shawshank Redemption

I think my favourite part was when the cast sing as Tommy is hanging in his cell… that was a wonderful moment, and almost worth the entrance fee alone.

Related Posts:

Artist Required

I really do need to find an artist to help me work on iPhone games!!

Please apply….

Related Posts:

%d bloggers like this: