zoukankan      html  css  js  c++  java
  • 一些问题

    }else if (indexPath.row == 2){

            UITableViewCell *cell2 = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell2"];

            cell2.textLabel.text = @"国际分类号";

    //        if ([self isBlankString:detailInfo.intCls] == NO) {

    //            cell2.detailTextLabel.text = detailInfo.intCls;

    //        }

            

    //        NSString *trimedString = [detailInfo.intCls stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

    //        if ([trimedString length] != 0) {

    //            cell2.detailTextLabel.text = detailInfo.intCls;

    //        }

            if ([self isNull: detailInfo.intCls] == NO) {

                cell2.detailTextLabel.text = detailInfo.intCls;

            }

            return cell2;

    =========================================

    - (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;

    }

    -(BOOL)isNull:(id)object

    {

        // 判断是否为空串

        if ([object isEqual:[NSNull null]]) {

            return NO;

        }

        else if ([object isKindOfClass:[NSNull class]])

        {

            return NO;

        }

        else if (object==nil){

            return NO;

        }

        return YES;

    }

    -(NSUInteger) unicodeLengthOfString: (NSString *) text {

        NSUInteger asciiLength = 0;

        

        for (NSUInteger i = 0; i < text.length; i++) {

            

            

            unichar uc = [text characterAtIndex: i];

            

            asciiLength += isascii(uc) ? 1 : 2;

        }

        

        NSUInteger unicodeLength = asciiLength / 2;

        

        if(asciiLength % 2) {

            unicodeLength++;

        }

        

        return unicodeLength;

    }

  • 相关阅读:
    DataGridView重绘painting简单实例
    C#实现万年历(农历、节气、节日、星座、属相、生肖、闰年等)
    《开源框架那点事儿11》:软件开发杂谈
    半年总结——欲戴王冠,必承其重
    三天学会HTML5 之第一天
    读书笔记 -《高效程序猿的45个习惯-敏捷开发修炼之道》
    Opengl ES 1.x NDK实例开发之七:旋转的纹理立方体
    我与小娜(08):人工智能的伟大胜利
    阿里云 oss 小文件上传进度显示
    模仿猫眼电影App一个动画效果
  • 原文地址:https://www.cnblogs.com/dexjay/p/4836489.html
Copyright © 2011-2022 走看看