zoukankan      html  css  js  c++  java
  • 字典排序

    //

    //  main.m

    //  字典排序

    //

    //  Created by 博博 on 16/1/8.

    //  Copyright (c) 2016年 com.bb. All rights reserved.

    //

    #define NSLog(FORMAT, ...) printf("%s ", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String])

    #import <Foundation/Foundation.h>

    int main(int argc, const char * argv[]) {

        @autoreleasepool {

            NSDictionary *dic=@{@"1-1":@"02",@"1-2":@"11",@"1-3":@"89",@"1-4":@"7"};

            NSArray *arr=[dic allValues];

    //        for(id str in arr){

    //            NSLog(@"%@",str);

    //        }

            arr=[arr sortedArrayUsingComparator:^NSComparisonResult(id obj1, id obj2){return [obj1 compare:obj2];}];

            

            for(id str in arr){

                NSLog(@"%@",str);

            }

            

            

        }

        return 0;

    }

  • 相关阅读:
    kafka搭建
    kafaka学习笔记
    metastore 简单说明
    二 python并发编程之多进程-理论
    文件指针偏移量
    FTP
    1 并发编程
    操作系统简介
    1 网络编程
    网络编程-osi七层
  • 原文地址:https://www.cnblogs.com/bobohahaha/p/5120936.html
Copyright © 2011-2022 走看看