as properties

works_for_me
Volker Birk 3 years ago
parent aaeaf45ea7
commit 7b63deb636

@ -12,6 +12,9 @@ NS_ASSUME_NONNULL_BEGIN
@interface pEpUpdater : NSObject
@property double cycle;
@property NSString* configPath;
-(id)init;
-(void)updateAll:(NSTimer*)timer;
-(void)updateWithFile:(NSString*)configFile

@ -12,19 +12,20 @@
@implementation pEpUpdater
const double CYCLE = 7200.0; // 7200 seconds = 2 hours
NSString* configPath = @"/Library/Application Support/pEp/Updater";
-(id)init
{
self = [super init];
if (self) {
[NSTimer scheduledTimerWithTimeInterval:CYCLE target:self selector:@selector(updateAll:) userInfo:nil repeats:YES];
}
_cycle = CYCLE;
_configPath = @"/Library/Application Support/pEp/Updater";
return self;
}
-(void)scheduleUpdates
{
[NSTimer scheduledTimerWithTimeInterval:CYCLE target:self selector:@selector(updateAll:) userInfo:nil repeats:YES];
}
-(void)updateAll:(NSTimer*)timer
{
// update all registered products

Loading…
Cancel
Save