在目标c中的二维数组中重复值

时间:2018-07-03 21:29:47

标签: objective-c arrays

我对目标c还是很陌生,所以我不确定这是一个简单还是复杂的问题。我得到了一个二维数组,每个子数组将只有两个值。第一个是要重复的值,第二个将是重复该值的次数。最好的方法是什么?

1 个答案:

答案 0 :(得分:0)

您根本不应该使用内部数组。使用两个属性为其创建一个类。

@interface Repetition
@property int value; // or whatever type
@property unsigned int count;
@end

@implementation Repitition
@end