detener la rotación de la vista

I have a tableview and detail view app, in the tableview I have this to stop it from being able to rotate.

- (BOOL)shouldAutorotateToInterfaceOrientation: (UIInterfaceOrientation)interfaceOrientation {
    return false;

so the main view should always be in portrait mode.

however the subview is able to change rotation freely.. if i go from the detail view while in landscape view to the parent tableview then the tableview appears in landscape and cannot rotate back.. hoping someone can help me fix this.

preguntado el 01 de febrero de 12 a las 01:02

1 Respuestas

You're telling it never to rotate, what you actually want is:

return (interfaceOrientation == UIInterfaceOrientationPortrait)

which says it should only rotate when it's to portrait orientation.

Respondido 01 Feb 12, 05:02

ah, yes I see. however this is giving me an error I typed this return (UIInterfaceOrientation == UIInterfaceOrientationPortrait) and now its saying *expected expression ')' - C.Johns

its working.. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation { return (interfaceOrientation == UIInterfaceOrientationPortrait);} - C.Johns

cheers :) thanks for that.. didn't solve my actual issue but helped my app work abit better :) - C.Johns

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.