Preheat the oven to 350°F (175°C) and grease a 9×5 inch loaf pan.
In a medium bowl, whisk together the flour, baking powder, baking soda, salt, and cinnamon.
In a large bowl, cream together the butter and sugar until light and fluffy. Beat in the eggs one at a time, then stir in the vanilla extract.
Gradually mix in the dry ingredients, alternating with the sour cream. Gently fold in the diced apples and chopped walnuts, if using.
Pour the batter into the prepared loaf pan and smooth the top.
Bake for 50 to 60 minutes, or until a toothpick inserted into the center comes out clean.
Allow the bread to cool in the pan for 10 minutes before transferring to a wire rack to cool completely.