I have an issue like, when I try to seperate string and fetching array from the same usingcomponentsSeparatedByString , the stringis having values but when it provides values to array , the array value is always null, please help me, I have attached code below.
self.str_amenitiesValues = [[NSString alloc] init];
self.str_amenitiesValues = [[arr_HotspotDetails valueForKey:@"Amenities"] objectAtIndex:0];
self.arr_amenities_values =[[NSArray alloc] init];
if (![self.str_amenitiesValues isEqualToString:@""])
{
//NSLog(@"%@",[self.str_amenitiesValues componentsSeparatedByString:@","]);
self.arr_amenities_values = [self.str_amenitiesValues componentsSeparatedByString:@","];
}
Make ur line as:
let me know if this helps you.