对于以下代码片段,我收到以下警告:“将保留的对象分配给不安全的属性;对象将在分配后被释放”。有人可以帮我解决这个问题吗?我设置 detailViewController.restaurantsSortedByDistance 的第二行是警告突出显示的部分.....
** RestaurantList.h **
@property (nonatomic) NSMutableArray *restaurantsSortedByDistance;
** end **
RestaurantList *detailViewController = [[RestaurantList alloc] initWithNibName:@"RestaurantList" bundle:nil];
detailViewController.restaurantsSortedByDistance = [[NSMutableArray alloc] initWithArray:[self returnRestaurantsSortedByDistance:rows]];