You can do both. Usually, nails go along the outside and screws in the "field," but I'll confess that it's been 30 years since I helped my dad do it (I was a big help, I'm sure) so perhaps the state of the art has changed.
Once upon a time it was nailed. Screws are a relatively recent change, I've used both.
The problem with nails is that they walk out over time. Secondarily, they can become "squeaky" when used in floors.
we used ring nails to shoot the subfloor onto the joices. and put down subfloor adhesive. we used nails because they were quick. screws would be better yes.