Apollo
Apollo

Reputation: 9064

Issue when converting a Xcode project to ARC

I've got the following warning: "Assigning retained object to unsafe property; object will be released after assignment" for the following snippet of code. Could somebody please help me clear this up? The second line where I set detailViewController.restaurantsSortedByDistance is the portion highlighted by the warning.....

**   RestaurantList.h **
    @property (nonatomic) NSMutableArray *restaurantsSortedByDistance;

**         end        **

 RestaurantList *detailViewController = [[RestaurantList alloc] initWithNibName:@"RestaurantList" bundle:nil];

        detailViewController.restaurantsSortedByDistance = [[NSMutableArray alloc] initWithArray:[self returnRestaurantsSortedByDistance:rows]];

Upvotes: 0

Views: 172

Answers (1)

Pochi
Pochi

Reputation: 13459

On your detailViewController.h set your restaurantsSortedByDistance property to strong.

Upvotes: 1

Related Questions