문제

I have created a UIImageView subclass. I have both the .h and .m files. I have a property in my UIImageView subclass. I dragged a UIImageView in a UIViewController. Now, I want to give a default value to the property. For example, i have an enum, and according to that enum value, i want to set the image of my imageView. How to give this value, when i am not calling the init method, i am loading it directly from the xib. I am stuck on this. Spent a lot of time, but not able to work it out.

도움이 되었습니까?

해결책

Ok i worked it out. I overrided the method:

initWithCoder:

and instantiated the values in that method!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top