Используйте переменную NSString, созданную в viewDidLoad внутри другого метода
В моемviewDidLoad
Метод, я установил следующие переменные:
// Get requested URL and set to variable currentURL
NSString *currentURL = self.URL.absoluteString;
//NSString *currentURL = mainWebView.request.URL.absoluteString;
NSLog(@"Current url:%@", currentURL);
//Get PDF file name
NSArray *urlArray = [currentURL componentsSeparatedByString:@"/"];
NSString *fullDocumentName = [urlArray lastObject];
NSLog(@"Full doc name:%@", fullDocumentName);
//Get PDF file name without ".pdf"
NSArray *docName = [fullDocumentName componentsSeparatedByString:@"."];
NSString *pdfName = [docName objectAtIndex:0];
Я хотел бы иметь возможность использовать эти переменные внутри другого метода (т.е.- (void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
)
Как я могу использовать эти переменные вне метода viewDidLoad? Я новичок ... помощь была бы ТАК оценена