IOS 开发中判断字符串是否为空字符的方法
2016-04-15 09:21
429 查看
NSUInteger是无符号的整型, NSInteger是有符号的整型,在表视图应用中常见 NSUInteger row= [indexPath row];因为这是显示tableViewCell有多少个,只能是非零整数的,也就是说,NSUInteger常用于索引值;
int与 NSInteger没有本质区别,只是一个定义为题
- (BOOL) isBlankString:(NSString *)string {
if (string == nil || string == NULL) {
return YES;
}
if ([string isKindOfClass:[NSNull class]]) {
return YES;
}
if ([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0) {
return YES;
}
return NO;
}
int与 NSInteger没有本质区别,只是一个定义为题
- (BOOL) isBlankString:(NSString *)string {
if (string == nil || string == NULL) {
return YES;
}
if ([string isKindOfClass:[NSNull class]]) {
return YES;
}
if ([[string stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]] length]==0) {
return YES;
}
return NO;
}
相关文章推荐
- IOS应用程序多语言本地化解决方案
- iOS学习笔记27-摄像头
- iOS开发 ☞ YY_Model
- iOS学习笔记27-摄像头
- OpenCV for Ios 标记检测2
- 【代码笔记】iOS-看图听故事
- ios中三种随机数方法
- iOS之使用AFN进行序列化处理(5)
- iOS 开发 SMSSDK-免费短信获取的实现方法
- iOS GCD, 同步,异步,串行队列,并行队列,dispatch_group
- iOS开发总结之仿qq侧滑功能
- ios开发之Protocol
- iOS 9.3 无法真机测试 Could not find Developer Disk Image
- iOS 8后本地通知需要注意
- 选择蜂窝教育iOS培训 为梦想努力
- iOS中的本地化(设置中文,英文,阿拉伯文等等)
- iOS开发中Xcode编译错误 linker command failed with exit co
- iOS 震动与系统声音
- iOS9开发最新常用第三方框架
- iOS移动开发1x 、2x 、3x图片介绍