我创建了这个 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 *)application 委托中实现它们时,clickEventMangement 方法不可用。
已编辑
- (void)applicationDidEnterBackground:(UIApplication *)application
{
clickEvent = [[clickEventManagement alloc] init];
[clickEvent -> "loadClicks" method is not available in the Xcode list
}
其他视图控制器中以相同方式声明的相同类可用。
谢谢!