Nokia's woes were on software side, not hardware. Building a competitive software stack proved too slow an undertaking for a hardware company. It was Android in the end that ate Nokia's pie, not Apple.
It is competition from the iPhone (and the possible control of search traffic on mobile devices that Apple would have) that forced Google to focus on Android after acquiring it and this lead to the demise of Nokia and the mobile division of Microsoft.
I don't know if Nokia knew the marketing budget going towards launching the iPhone along with other resources planned for its launch would that have changed their view on how serious of a competitor the iPhone is going to be.