0
    MDRadialProgressTheme *newTheme = [[MDRadialProgressTheme alloc] init];
    newTheme.completedColor = [UIColor whiteColor];
    newTheme.incompletedColor =[UIColor darkGrayColor]; //[UIColor colorWithRed:177/255.0 green:179/255.0 blue:181/255.0 alpha:1.0];
    newTheme.centerColor = [UIColor clearColor];
    //newTheme.centerColor = [UIColor colorWithRed:219/255.0f green:220/255.0f blue:221.0 alpha:1.0f];
    newTheme.sliceDividerHidden = YES;
    newTheme.labelColor = [UIColor blackColor];
    newTheme.labelShadowColor = [UIColor whiteColor];

    CGRect frame = CGRectMake(0,0, 45, 45);

    radialView = [[MDRadialProgressView alloc] initWithFrame:frame andTheme:newTheme]; // warning here
    // Assigning retained object to unsafe_unretained variable; object will be released after assignment

    radialView.center=CGPointMake(self.bounds.size.width / 2.0f, self.bounds.size.width / 2.0f);
    radialView.progressTotal = 4;
    radialView.clockwise =YES;
    radialView.label.hidden =YES;
    radialView.progressCounter = 1;
    [self addSubview:radialView];

I get a warning on the line radialView = [[MDRadialProgressView saying Assigning retained object to unsafe_unretained variable; object will be released after assignment

What does it mean and how do I fix it?


 @property (nonatomic,assign) MDRadialProgressView *radialView;

radialView is declared in the header (see above)

Sven
  • 21,790
  • 4
  • 48
  • 70
software is fun
  • 5,999
  • 15
  • 49
  • 99

1 Answers1

2

Change your property to

@property (nonatomic, strong) MDRadialProgressView *radialView;
almas
  • 6,644
  • 6
  • 30
  • 46
  • Thanks but can you explain what the difference is? – software is fun Jun 23 '15 at 19:52
  • 1
    radialView is a object, so you need a strong property to keep it in memory. 'Assign' is usually used with primitive types, e.g. float, int, etc. Here is a good explanation of weak and strong pointers: http://stackoverflow.com/a/9262768/1068243 – almas Jun 23 '15 at 19:53