空字符串
在ios應用中,如果從網絡請求數據,返回json或者是xml格式的數據時,經常會遇到空串,一般接口是用java等語言寫的,如果是安卓,因為源語言都是java,只需判斷是否等于null即可,但是在ios中會出現各種各項的形式,比如null,(null),<null>。
如果單純用
完整判斷方法
TypesItem.h
@synthesize type_id,type_memo,type_name;
- (id)copyWithZone:(NSZone *)zone
{
TypesItem *newItem = [[TypesItem allocWithZone:zone] init];
newItem.type_name = self.type_name;
newItem.type_id = self.type_id;
newItem.type_memo = self.type_memo;
return newItem;
}
在B中.h文件寫上代碼
新聞熱點
疑難解答