我有2個UIViewController類 - DocumentViewController和LibraryViewController。ARC語義問題 - 沒有可見的@interface
在課堂上DocumentViewController,我有以下代碼:
- (id)initWithURL:(NSString *)linkToPdf withFileName:(NSString *)fileName{
//some code goes here ...
}
,我想使用的代碼從LibraryViewController加載DocumentViewController類:
DocumentViewController *documentViewController = [[DocumentViewController alloc] initWithURL:@"http://investor.google.com/pdf/2012Q4_google_earnings_slides.pdf" withFileName:@"Google Earnings Slides"];
[self presentViewController:documentViewController animated:NO completion:nil];
當我建,我得到LibraryViewController類中出現錯誤,說 'DocumentViewController'沒有可見的@interface用initWithURL聲明選擇器:withFileName:
我該如何解決這個問題?
您是否在.h中添加了方法聲明?你有沒有導入.h文件? – rmaddy 2013-04-10 23:53:07