Why self.view is not available
Posted
by amok
on Stack Overflow
See other posts from Stack Overflow
or by amok
Published on 2010-05-29T16:24:53Z
Indexed on
2010/05/29
16:32 UTC
Read the original article
Hit count: 196
I have this code in the main view controller and it is working just fine and as I wanted.
loadingActionSheet = [[UIActionSheet alloc] initWithTitle:@"Posting To Twitter..."
delegate:nil
cancelButtonTitle:@"Cancel"
destructiveButtonTitle:nil
otherButtonTitles:nil];
[loadingActionSheet showInView:self.view];
I wanted that code to be reusable from different part of the project so I moved it in a separate file (UIView based).
The poblem that I am facing is that self.view is not available there and I don't know why because I am learning and I don't know enough to understand what I am missing.
What do I have to do/add/change to have the actionsheet shown in my current view even if that code lives somewhere else?
© Stack Overflow or respective owner