What came first, the book or the movie?

Usually a book is written and the movie follows, but with The Last Song by Nicholas Sparks, it was a different case.  In an interview with Borders, Nicholas Sparks said that he was writing the screenplay at the same time that he was writing the book.  They wanted to release the movie fast so he actually was writing the screenplay first.  I thought that was amazing, and it must have required so much on his part.  I wonder how many best-selling authors would be able to do that if asked.  In my humble opinion, even that it is the same story, there are such different environments, that the process of writing the book would be affected.  Obviously, this did not happen to him, and I admire him for being able to do this.  I am sure that his fans and the movie fans as well thank him for doing this.

So, what came first the book or the movie?  In the case of The Last Song, it seems that the movie came first.