Je ne connais pas C. Comment passer un tableau C à une fonction Objective-C?Comment passer un tableau C à une fonction objectif-C?
J'ai en fait besoin d'un exemple d'une fonction de classe convertissant NSArray en C arrays. C'est ce que j'ai jusqu'à présent:
+ (NSArray *)convertArray:(NSString*)array { //I don't think this is correct: the argument is just a NSString parameter and not an array
NSMutableArray * targetArray = [NSMutableArray array];
for (i = 0; i < SIZE; i++) //SIZE: I dunno how to get the size of a C array.
{
[targetArray addObject: [NSString stringWithString:array[i]];
}
return targetArray;
}
Jetez un oeil à l'adresse http : //stackoverflow.com/questions/8086634/creating-a-nsarray-from-ac-array et http://stackoverflow.com/questions/5150312/using-c-arrays-in-objective-c –