Your code checks whether self.foodName.text is nil. Which means there is no text object. That is most likely not what you actually wanted to check. There is a difference between "no NSString object" and "an NSString object containing no characters at all".
If you want to check whether text is either no object at all, or a real object but with no text inside, then the easiest is self.foodName.text.length == 0. Perhaps you wanted to do something more complicated, like checking if there is no text, or only space characters, then the answer above using stringByTrimmingCharactersInSet will do this.
Both the simple check here and the more complicated one with stringByTrimmingCharactersInSet use a very common Objective-C technique: If you send a method to a nil object, or try to access a property of a nil object, the result is 0 / NO / nil, whatever is appropriate. So if text == nil, then text.length == 0. stringByTrimmingCharactersInSet returns nil, and nil.length again is 0, so you don't have to check for this.