how to add nil to nsmutablearray?

后端 未结 9 1272
-上瘾入骨i
-上瘾入骨i 2020-12-13 12:22
NSArray *array = [[NSArray alloc] initWithObjects:@\"ΕΛΤΑ\",
                      @\"ΕΛΤΑ COURIER\", @\"ACS\", @\"ACS ΕΞΩΤΕΡΙΚΟ\", 
                      @\"DHL\",          


        
9条回答
  •  南方客
    南方客 (楼主)
    2020-12-13 13:04

    You don't need to call [addObject:nil]

    The nil in initWithObjects: is only there to tell the method where the list ends, because of how C varargs work. When you add objects one-by-one with addObject: you don't need to add a nil.

提交回复
热议问题