Im trying to create a json array out of nsmutable array.
To do so, Im trying to convert nsmutable array to nsdata as follows,
NSData *dataArray = [NSKeyedArchiver archivedDataWithRootObject:self.countryNameArray];
self.countryNameArray is a mutable array that contains names of countries.
Then Im trying to create a json array out of NSData as follows
NSString* jsonArray = [[NSString alloc] initWithBytes:[dataArray bytes] length:[dataArray length] encoding:NSUTF8StringEncoding];
but the problem is that, jsonArray is null when Im trying to use it.