0

I have my code in java as follows but I don't know how to convert it.

public  int[] originalPixels;
public  int[][] RGB1;
public  int[][] RGB2;
user3863537
  • 101
  • 1
  • 12
  • possible duplicate of [How to initialize an empty mutable array in Objective C](http://stackoverflow.com/questions/10224762/how-to-initialize-an-empty-mutable-array-in-objective-c) – Olter Aug 07 '14 at 07:07

2 Answers2

0

Depends on what exactly you want to achieve you can create a property of type NSArray (if it doesn't have to be mutable) or NSMutableArray if you want to modify that array. You could also you a C style of arrays but I think the object version is more convenient and Objective-C world.

This is very basic problem so I would recommend you to read some tutorial with basis of objective-C as there is quite a lot of details you should be aware to fits your demands :)

Some helpful links:

Community
  • 1
  • 1
Julian
  • 9,299
  • 5
  • 48
  • 65
0

The c/c++ is more closer to hardware than java. The array is mean the postion of the memory. So you can use pointers. int* originalPixels; or int** RGB1; int** RGB2; After the declare you sholud allocate them.

Attila
  • 16
  • 2