How do I test if an NSString
is empty in Objective C?
相关问题
- CALayer - backgroundColor flipped?
- Core Data lightweight migration crashes after App
- How can I implement password recovery in an iPhone
- State preservation and restoration strategies with
- “Zero out” sensitive String data in Swift
相关文章
- 现在使用swift开发ios应用好还是swift?
- UITableView dragging distance with UIRefreshContro
- TCC __TCCAccessRequest_block_invoke
- Where does a host app handle NSExtensionContext#co
- xcode 4 garbage collection removed?
- Unable to process app at this time due to a genera
- Swift - hide pickerView after value selected
- How can I add media attachments to my push notific
The best way is to use the category.
You can check the following function. Which has all the conditions to check.
check this :
Or
Hope this will help.
May be this answer is the duplicate of already given answers, but i did few modification and changes in the order of checking the conditions. Please refer the below code:
You have 2 methods to check whether the string is empty or not:
Let's suppose your string name is
NSString *strIsEmpty
.Method 1:
Method 2:
Choose any of the above method and get to know whether string is empty or not.
Just pass your string to following method: