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
Try the following
You can check either your string is empty or not my using this method:
Best practice is to make a shared class say UtilityClass and ad this method so that you would be able to use this method by just calling it through out your application.
I have checked an empty string using below code :
You can check if
[string length] == 0
. This will check if it's a valid but empty string (@"") as well as if it's nil, since callinglength
on nil will also return 0.