zoukankan      html  css  js  c++  java
  • 创建 数组规定每组个数

    创建数组规定每组个数

     

     

     NSArray *array = [UIFont familyNames];

            _fontArray  = [[NSMutableArray alloc]initWithCapacity:13];

            NSMutableArray *temp = nil;

            for (int index = 0; index < [array count]; index++) {

                //取出字体

                NSString *font =array[index];

                if (index % 5 == 0) {

                    temp =[[NSMutableArray alloc]initWithCapacity:5];

                    [_fontArray addObject:temp];

                    [temp release];

                }//将整除5时,创建temp数组,添加到 _fontArray

                [temp addObject:font];//将字体放到temp 中

            }

        //将字体放入数组

  • 相关阅读:
    变量
    总结 对象
    学生管理系统
    [Altera] Device Part Number Format
    [Matlab] sum
    [Matlab] Galois Field
    [C] static和extern的作用
    [Python] list
    [Python] raw_input
    [软件] UnicornViewer
  • 原文地址:https://www.cnblogs.com/meixian/p/5370852.html
Copyright © 2011-2022 走看看