Reprinted from: http://bbs.9ria.com/thread-235206-1-1.html
Judging that the NSString string is empty is a problem that almost every developer will encounter. For most people, the first thing that flashes to the brain is the following method But unfortunately, such judgments often fail, resulting in many inexplicable bugs. For example, if this method is used to judge whether the UITextField is empty, there will be problems. Although the above line of code can work normally, it is a bit depressing to have to write such a line of code every time. In fact, there is a simple and clear workaround method, which I recommend everyone to use: Original link: http://www.cnblogs.com/hellocby/archive/2012/12/20/2826318.html |