Prisoners are being treated to 17,000 apple pies a week in a bid to keep them sweet.

The prison officers' union says the Corrections Department turned to the dessert in a bid to keep inmates calm after smoking was banned.

Apple pie is now dished up as a treat for inmates three times a week - totalling 17,000 pies.

Corrections Association president Beven Hanlon said the pies were introduced as a "sweetener" after the smoking ban came into force in July 2011. "And they can't take it away otherwise we'll get things like riots."

The Corrections Department said the pies were not being used to keep inmates happy.

It used nicotine patches and a popular vegetable instead.

"Prisoners were offered carrot sticks as a healthy snacking alternative to assist with cigarette withdrawal when prisons went smokefree in 2011."

It said prisoners were dining on apple pies for dessert on Mondays, Wednesdays and Fridays because they were pre-portioned and convenient.

For a treat on Christmas Day, the prisoners are allowed custard on their pie.

Inmates can spend up to $70 a week on snack food and toiletries, with prisoner meals costing about $4.50 per prisoner per day.

Kathy Kearns, co-owner of the award-winning Viands Bakery in Kihikihi, said she was not surprised by the apple pie choice.

"It's like comfort food, reminiscent of mum's homemade apple pie."

She had also turned to apples as a way to deal with sweet cravings when she gave up smoking, she said.

A Quitline spokesman said that, anecdotally, there could be three plausible reasons why an apple pie was the perfect cigarette substitute.

Among a host of other ingredients, cigarettes contained sugar so once a person stopped smoking their blood sugar level dropped and that sweet craving kicked in.

"And there's the habit of the hand to mouth. People start eating, so it's just the habit forming."