hsousa / HCSStarRatingView

Simple star rating view for iOS written in Objective-C
MIT License
1.28k stars 196 forks source link

Values are not updating -Interface Builder #57

Closed chathuralakmal closed 7 years ago

chathuralakmal commented 7 years ago

I have added the StarRatings to Interface builder. and using side panel i can update the values and set images fine. but when ever i try to update the values it doesnt effect.

I simply created outlet and created following. _starRatings = [HCSStarRatingView new]; _starRatings.minimumValue = 0.0; _starRatings.maximumValue = 5.0; _starRatings.maximumValue = 2.0; _starRatings.emptyStarImage = [UIImage imageNamed:@"star_empty"]; _starRatings.filledStarImage = [UIImage imageNamed:@"star_full"];

only displaying values that i added in interface builder.

hsousa commented 7 years ago

If you do _starRatings = [HCSStarRatingView new]; and _starRatings is an outlet, you just destroyed that outlet connection.

If you're using interface builder for this you shouldn't need to do any configuration on your code (unless it changes dynamically).

Try removing all those lines and just do self.starRatings.value = <your_value>;

chathuralakmal commented 7 years ago

Oh thank you very much. i just understand it.