无法从AppDelegate访问NSObject的公共方法

时间:2012-07-31 13:41:32

标签: objective-c ios5

我创建了这个NSObject子类:

#import <Foundation/Foundation.h>
#import "SQLiteManager.h"

@interface clickEventManagement : NSObject{

    SQLiteManager *dbManager;

    NSURLConnection *adsconnection;

    NSMutableData *responseData;

}

@property (strong, nonatomic) NSURLConnection *adsconnection;

-(void) insertClickAdd:(int)zona;

-(void) insertPrintAdd:(int)zona;

-(NSArray*) loadClicks;

@end

我已经在AppDelegate.h中声明了它:

#import "clickEventManagement.h"

@interface AppDelegate : NSObject <UIApplicationDelegate, AVAudioSessionDelegate>

{

    BOOL firstRun;

    AVPlayer *player;

    clickEventManagement *clickEvent;


}

@property (strong, nonatomic) clickEventManagement *clickEvent;

但是当我尝试在 - (void)applicationDidEnterBackground:(UIApplication *)应用程序委托中实现它们时,clickEventMangement方法不可用。

EDITED

- (void)applicationDidEnterBackground:(UIApplication *)application
{

    clickEvent = [[clickEventManagement alloc] init];

    [clickEvent -> "loadClicks" method is not available in the Xcode list


}

其他视图控制器中的相同类(以相同方式声明)可用。

谢谢!

1 个答案:

答案 0 :(得分:0)

如果代码编译,并且您的意思是自动完成功能无效,我已成功删除xcworkspace文件,如此处所接受的解决方案中所述:Xcode 4 - slow performance