I agree that the answer could be pine, because there is a sweet called pineapple balls (the sticky sweet could be a toffee apple or another type of pineapple confectionary).
I also think that the answer could be Eucalyptus because 'Gum Tree' is a term for a type of Eucalyptus.
Therefore the phrase 'barking up a gum tree' could refer to the 'yearning' part of the clue (getting the wrong message). The sweet is a gumball, and after the last part has been thrown (the ball), you are left with gum. This might be too obscure though, as I'm not sure how cryptic your quiz is.