I tried removeFromSuperview on a view that had not been added as a subview but Xcode 4 didn’t throw any error. Is this expected behaviour?
I tried removeFromSuperview on a view that had not been added as a subview
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
First off, Xcode 4 wouldn’t do anything at all. That’s the IDE. It has nothing to do with the runtime behavior of your app.
Secondly, the documentation for
-removeFromSuperviewstatesWhat part of this would lead you to expect
-removeFromSuperviewto throw an exception if the view has no superview?In any case, the answer is yes, this is normal.
-removeFromSuperviewdoes not throw exceptions.