I created a UIView and a UILabel outlet for the XIB. In the first load is fine then I execute the removeFromSuperview to remove that UIView and call again the addsub to show that UIView again. But when I tried to access again the UILabel like the setText method then the app will crash. Do you think its about removeFromSuperview?
Thanks
sasayins
removeFromSuperview releases UIView. If the retainCount of the UIView hit zero, then it is dealloc’ed and it releases the children of the UIView. If UILabel is on UIView, it too is released. The UIView has to be reloaded before you call addView. You have to load it manually.
Try calling
before you call addView. You also should be able to set the UILabel, before or after addView, if you call loadNibNamed.
Of course your problem could be something else, especially if your UIView is being retained.
Try running the Xcode debugger and step through the code.