small medium large xlarge

Generic-user-small
14 Oct 2009, 07:40
Daniel Gardopee (5 posts)

Bill - great screencasts. I’ve been buying them all.

I should mention first, i’m using Xcode 3.2.1

I have a couple questions..

In Episode 1 you are talking about the @property directive. I’ve noticed that you don’t actually need to put the variables in the @interface { } block at all, if you use @property down below. Is there any reason you used them in the screencast?

Secondly, in Episode 2 regarding memory management - as of Xcode 3.2.1, calling [movie release] and then [movie play] directly after it does not seem to cause any errors or gdb halts. In fact, even though the reference count got reduced from 1 to 0 and dealloc was called, [movie play] still works and outputs correctly. Is there a reason for this? One thing of interest is, before I took a vacation, I went through these episodes while following along with Xcode 3.2 and I do remember an error happening in this case in that version - a slightly different error than the one in your screencast, but similar.

Any help is appreciated.

Biopic_100x100_pragsmall
14 Oct 2009, 11:25
Bill Dudney (917 posts)

Hi Daniel,

Thanks for the kind words!

  • properties - you don’t have to have ivars but if you don’t the app won’t run in the ‘old’ objc runtime. The simulator used the old runtime in 3.2 so I put the ivars in so it would run on the simulator. I wonder if they upgraded it in 3.2.1… I’ll have to look.

  • memory - when an object is dealloc’ed its memory is not immediately reused and until it is the object will continue to more or less act ‘normal’. To force a problem… between the release and the play allocate a few objects and then see if you get some bad behavior.

Good luck and please let me know if any of this does not make sense.

You must be logged in to comment