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