how to add nil to nsmutablearray?

If you must add a nil object to a collection, use the NSNull class:

The NSNull class defines a singleton object used to represent null values in collection objects (which don’t allow nil values).

Assuming “array” is of type NSMutableArray:

....
[array addObject:[NSNumber numberWithInt:2];
[array addObject:@"string"];
[array addObject:[NSNull null]];

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)