2013-08-04 44 views
0

我使用的使用,看起來像一個參數返回AA系列INTS的庫:最好的辦法**

INT ** OUTLIST

什麼是最好的方式把它包裹在一堆NSNumber對象中(也許是一個NSArray來保存它們)?

回答

0

沒有捷徑,我知道。你可以這樣寫:

int **outList = ... 
int count = ... 
NSMutableArray *result = [[NSMutableArray alloc] initWithCapacity:count]; 

for (int idx = 0; idx < count; idx++) 
    [result addObject:@(outList[idx])]; 

希望它有幫助!