2011-03-09 90 views
1

我在做什麼錯?這是.h文件:找不到方法定義

#import <UIKit/UIKit.h> 
#import <sqlite3.h> 

@class ReaderViewController; 

@interface ReaderAppDelegate : NSObject <UIApplicationDelegate> { 
    UIWindow *window; 
    ReaderViewController *viewController; 
} 

@property (nonatomic, retain) IBOutlet UIWindow *window; 
@property (nonatomic, retain) IBOutlet ReaderViewController *viewController; 

- (void)checkForDatabase; 
//- (void)SQLiteConnection: (NSString *)defaultDBPath; 
@end 

此處顯示的錯誤:

screen shot of compile results

+0

那麼,該屏幕截圖不會顯示錯誤消息。它只是說編譯器失敗了。你能發佈特定的編譯器錯誤消息嗎?另外,是否定義了ReaderViewController類? – hennes 2011-03-09 16:50:10

回答

1

您正在調用哪一個沒有出現在.m文件存在的[self checkForDatabase]方法。


未完全執行警告是因爲你宣佈你的界面

方法定義錯誤checkForDatabase方法是因爲你正試圖調用的方法application:didFinishLaunchingWithOptions:缺少方法。

1

您未能執行checkForDatabaseReaderAppDelegate.m(或者您鏈接到項目中的任何其他文件)。你說你會在頭上,然後你沒有。

+0

Rob,theChrisKent:我把它放在一個名爲SQLiteDB.m的文件中...是不是在XCode中允許的?我想在一個文件中分離所有的SQLite方法。我想我需要問:我該怎麼做? – SpokaneDude 2011-03-09 16:54:04

+0

您可以這樣做,但您需要將其作爲ReaderAppDelegate的擴展或類別來執行。 http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/ObjectiveC/Chapters/ocCategories.html – 2011-03-09 23:21:49