How to create an Array of Strings in Objective c for iphone

后端 未结 4 1012
深忆病人
深忆病人 2020-12-30 19:48

I\'m trying to create an array of strings that can be randomized and limited to a certain x number of strings.

If the array could be randomized I could pick the firs

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-30 20:26

    As of Xcode 4.4, you can use Array Literals, which are much cleaner and easier to read. You no longer need to include 'nil'. For example:

    NSArray *myArray = @[@"1", @"2", @"3", @"4", @"5"];
    

提交回复
热议问题