Level : WORDPRESS BOOK LINKEDIN PATENT Send Mail 동냥하기 hajunho.com

반응형

      UIAlertController *AlertView = [UIAlertController alertControllerWithTitle:@"popup" message:@"추가 저장 하시겠습니까?"    preferredStyle:UIAlertControllerStyleActionSheet];
                           
                           UIAlertAction *ok = [UIAlertAction actionWithTitle:@"예" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action)
                                                {
                               
                               [self WTF];
                               
                               
                               [AlertView dismissViewControllerAnimated:YES completion:nil];
                           }];
                           
                           UIAlertAction *cancel = [UIAlertAction actionWithTitle:@"아니요" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action)
                                                    {
                               [AlertView dismissViewControllerAnimated:YES completion:nil];
                           }];
                           
                           [AlertView addAction:ok];
                           [AlertView addAction:cancel];
                           [self presentViewController:AlertView animated:YES completion:nil];
                           

target does not implement selector


doBackgroundWork -> doBackgroundWork:

.h
NSConditionLock *theConditionLock;


.m


enum {
    kWorkTodo = 1,
    kNoWorkTodo = 0
};


theConditionLock = [[NSConditionLock alloc] initWithCondition: kNoWorkTodo];
   [theConditionLock unlockWithCondition:kWorkTodo]; // Wait until there is work to do
  [self startDoingWork];


- (void)doBackgroundWork:(id)arg {
    while (thread1) {
        NSLog(@"thread===`==========================================");
        [theConditionLock lockWhenCondition:kWorkTodo]; //스스로 멈춤.
    }    
}


- (void)startDoingWork {
    [NSThread detachNewThreadSelector:@selector(doBackgroundWork:) toTarget:self withObject:nil];
}


Variable is not assignable (missing __block type specifier)

    [theConditionLock lock];

    [theConditionLock unlockWithCondition:kWorkTodo]; //언락시 다시 돎. 언락 때마다 실행 가능.


반응형

'살며 생각하며,' 카테고리의 다른 글

개 발 일 지 040  (0) 2019.12.10
개 발 일 지 039  (0) 2019.12.09
개 발 일 지 037  (0) 2019.12.06
개 발 일 지 036  (0) 2019.12.04
개 발 일 지 035  (0) 2019.12.04
  • 네이버 블러그 공유하기
  • 네이버 밴드에 공유하기
  • 페이스북 공유하기
  • 카카오스토리 공유하기