타이머 선언

타이머 ID를 여러 개 선언해서 동시에 여러 개의 타이머를 돌리는 것도 가능하다.

NSTimer *timer;
NSString *str = @"Timer";
timer = [NSTimer scheduledTimerWithTimeInterval:60.0 target:self
                                           selector:@selector(updateMethod:) userInfo:str repeats:YES];


콜백 함수

- (void) updateMethod:(NSTimer *)incomingTimer
{
    NSLog(@"Inside update method");
    if ([incomingTimer userInfo] != nil)
        NSLog(@"userInfo: %@", [incomingTimer userInfo]);
}


아래와 같이 다중 타이머 선언 시 selector를 이용하여 각 타이머 별로 다중 작업이 가능하다

    NSTimer *locktimer;
    NSTimer *policytimer;
    NSString *lockstr = @"DeviceLock Timer";
    NSString *policystr = @"Policy Timer";
    
    locktimer = [NSTimer scheduledTimerWithTimeInterval:30.0 target:self
                                           selector:@selector(updateDeviceLockInfo:) userInfo:lockstr repeats:YES];
    
    policytimer = [NSTimer scheduledTimerWithTimeInterval:60.0 target:self
                                           selector:@selector(updatePolicyInfo:) userInfo:policystr repeats:YES];
- (void) updatePolicyInfo:(NSTimer *)incomingTimer
{
    NSLog(@"Inside updatePolicyInfo method");
    if ([incomingTimer userInfo] != nil)
        NSLog(@"userInfo: %@", [incomingTimer userInfo]);
}
- (void) updateDeviceLockInfo:(NSTimer *)incomingTimer
{
    NSLog(@"Inside updateDeviceLockInfo method");
    if ([incomingTimer userInfo] != nil)
        NSLog(@"userInfo: %@", [incomingTimer userInfo]);
}




MySQL 접속

mysql -uroot -p mysql


접속 계정 생성

insert into user (host, user, password) values('%', 'User ID', password('User Password'));
flush privileges;


접근권한 설정(localhost)

DataBase Name.* to User ID@localhost identified by 'User Password' with grant option;


접근권한 설정(remote)

grant all privileges on DataBase Name.* to User ID@'%' identified by 'User Password' with grant option;
flush privileges;



사용자 등록 확인

select host, user, password from user;


my.cnf 파일 수정(bind-address 주석 처리)

#bind-address           = 127.0.0.1


MySQL 재시작

service mysql restart


root@ios-mdm:/etc/init.d# vi mdm_server.sh

root@ios-mdm:/etc/init.d# chmod +x /etc/init.d/mdm_server.sh

root@ios-mdm:/etc/init.d# update-rc.d mdm_server.sh defaults

+ Recent posts