我有一个问题,例如,当我尝试分离字符串并从同一个 usingcomponentsSeparatedByString 获取数组时,字符串具有值,但是当它向数组提供值时,数组值始终为空,请帮助我,我在下面附上了代码。
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:@","];
}