Memory error with app termination in viewDidLayoutSubviews

113 views Asked by At

I have setBackgroundImage in viewDidLayoutSubviews. It calls viewDidLayoutSubviews infinitely. As a result memory is increased with app termination. What am I doing wrong? It happens only in iPhone 5s and the same code works fine in iPad Air and iPhone 4s.

[_hosStartDateBtn setBackgroundImage:[UIImage imageNamed:@"cal23.png"] forState:UIControlStateNormal];
//_hosStartDateBtn is a button added programatically in viewDidLayoutSubviews
0

There are 0 answers