David Tannock was born at Tarbolton, Ayrshire, Scotland, on 23 September 1873, the son of William Tannock, a ploughman, and his wife, Jane McCall. Tannock was educated at the public school at Mauchline and at Glasgow and West of Scotland Technical College. In 1896 he secured a position as a gardener at the Royal Botanic Gardens, Kew, and quickly progressed to become a foreman in the tropical section. He was appointed an instructor at the agricultural school in Dominica, West Indies, in 1898 on the strong recommendation of the director of Kew. Tannock advanced to become curator of the school's botanic garden, then officer-in-charge of the school.
In February 1903 the Dunedin City Council appointed Tannock superintendent of reserves. On taking up the position in June he made a far-sighted report to the council, detailing how the Botanic Gardens and city reserves could be improved; when he retired, 37 years later, he had achieved all these initial aims and many more. Tannock was married at Invercargill on 4 March 1904 to Jessie Stirling, who was also from Scotland. They were to have five children.
Training at Kew had given Tannock a clear vision of the nature and purpose of a botanic garden. In 1903 the Dunedin Botanic Gardens comprised little besides an acclimatisation reserve, arboretum, aviary, tree and shrub nursery and a propagating house. While Tannock never lost sight of his goal of establishing a true botanic garden, he designed all features to have wide public appeal. He recognised that recreational attractions such as the maze, aviary, band rotunda, deer pen, aquarium and tea kiosk would promote the gardens' popularity. His first major improvement was the winter garden in 1908, whose construction costs were met by local businessman Robert Glendining. By the late 1920s the rock garden, rhododendron dell, azalea garden and New Zealand native plant collections had become nationally significant in size and diversity. Other features established or substantially extended by Tannock included the arboretum, rose garden, Shakespeare and knot gardens and various geographical collections.
A strong belief in the value of horticultural education inspired Tannock to set up a school garden in 1916–17. The labelled flower-beds, lawns and vegetable plots were used mainly by trainee teachers and Botanic Gardens staff. By the mid 1920s Tannock had established a five-year training programme that included full-time employment in the Botanic Gardens and evening lectures at King Edward Technical College. Young women and men from throughout New Zealand were accepted as trainees. Many of the men trained by Tannock went on to head parks and reserves departments.
In 1926 Tannock convened a meeting that led to the formation of the New Zealand Association of Gardens, Parks and Reserves Superintendents. He also embarked on an ambitious afforestation programme for Dunedin, carefully detailing the economic and social benefits of the scheme in his reports to the council. By his retirement the city's forests covered 13,000 acres and Tannock was an internationally recognised authority on silviculture. In New Zealand local authorities and private companies frequently sought his advice on silviculture and horticulture.
Throughout his time as superintendent Tannock advocated adequate recreation areas and was especially concerned that children's play requirements were met. In 1903 there were only a few rough football grounds and cricket wickets, but when he retired in June 1940 there were 32 children's playgrounds, 179 sports fields, two swimming-baths and two golf-courses. The extensive town-belt buffer between the city centre and the suburbs had also been freed of noxious weeds and planted with native trees. Other major projects were the conversion of the Oval from a rubbish tip to a high-quality playing field, the reclamation of Lake Logan and the formation of Logan Park, and the rehabilitation of Woodhaugh as a native plant reserve and its development as a recreation area.
Tannock was a popular and respected public figure, renowned for his tact and patience. He took an active part in local and national horticultural groups. His international standing as a horticulturist was recognised by his being made a fellow and later (1930) an associate of honour of the Royal Horticultural Society, London. In 1948 he was made an OBE for his services to New Zealand silviculture and horticulture. As well as giving numerous public lectures, writing a gardening column in the Otago Daily Times and delivering a weekly radio broadcast on 4ZB Dunedin, Tannock wrote four popular books on gardening: Manual of gardening in New Zealand ( c.1914), Potato growing in New Zealand (1922), Rock gardening in New Zealand (1924) and Practical gardening in New Zealand (1934).
Tannock maintained a lifelong affiliation with the Presbyterian church. He was a member of the session and deacons' court of First Church and on the board of governors of Knox and St Margaret's colleges. Jessie Tannock died in June 1931 and on 28 October 1936, at Dunedin, Tannock married Mary Frances Timlin.
David Tannock died near Kew Gardens at Richmond, Surrey, on 3 June 1952 while on holiday in England. He was survived by Mary Tannock and two children of his first marriage. Tannock had been a man of immense vision. His work permanently enhanced the quality of life in Dunedin and the status of horticulture in New Zealand.