zoukankan      html  css  js  c++  java
  • OC数组中文排序

     

     

    -(void)sortStudentInfo

    {

        if(studentInfoArray && studentInfoArray.count > 0)

        {

            for(TWDetaiAnswerResultStudentInfoVO *studentInfo in studentInfoArray)

            {

                studentInfo.sortName = [NSMutableString stringWithString:studentInfo.studentName];

                CFStringTransform((CFMutableStringRef)studentInfo.sortName, NULL, kCFStringTransformToLatin, false);

            }

            

            NSMutableArray *array = [NSMutableArray arrayWithArray:studentInfoArray];

            

            array = [array sortedArrayUsingComparator:^NSComparisonResult(TWDetaiAnswerResultStudentInfoVO *studentInfo1, TWDetaiAnswerResultStudentInfoVO *studentInfo2)

                                {

                                    NSComparisonResult result = [studentInfo1.sortName compare:studentInfo2.sortName];

                                    return result;

                                }];

            

            [studentInfoArray removeAllObjects];

            [studentInfoArray addObjectsFromArray:array];

        }

    }

  • 相关阅读:
    Luogu P1596 [USACO10OCT]湖计数Lake Counting
    Luogu P1757 通天之分组背包
    数据建模笔记1
    单纯形算法 matlab
    有效集 matlab代码
    拟牛顿 DFP matlab
    FR共轭梯度法 matlab
    整数规划
    线性规划 Matlab
    远期、期货和互换(三)
  • 原文地址:https://www.cnblogs.com/xiangjune/p/5189170.html
Copyright © 2011-2022 走看看