[self showMeThePicture];

-(void)showMeThePicture {
    //    [mTextDfctCnts resignFirstResponder];
    Hgallery *v = [[Hgallery alloc] initWithNibName:@"HGallery" bundle:[NSBundle mainBundle]];
    self.title = @"";
    
    v.mType = @"I";
    
    v.mFormerPictures =mPictureOfDefect;
    [self.navigationController pushViewController:v animated:NO];
}

good songs.
like a star
put your records on
the skies will break

카메라 권한 체크 후 미체크 시 설정 창으로 이동
    AVAuthorizationStatus status = [AVCaptureDevice authorizationStatusForMediaType:AVMediaTypeVideo];
    
    switch (status){
        case AVAuthorizationStatusAuthorized:{
            // 동의함
        };
            break;
            
        case AVAuthorizationStatusNotDetermined:{
            // 정의 안됨 (동의전)
            [AVCaptureDevice requestAccessForMediaType:AVMediaTypeVideo completionHandler:^(BOOL granted) {
                
                if (granted) {
                    //Granted access to mediaType
                    dispatch_async (dispatch_get_main_queue (), ^{
                    });
                }
            }];
        };
            
            break;
    
        case AVAuthorizationStatusDenied:{
            // 동의안함
            UIAlertController * alert=   [UIAlertController
                                          alertControllerWithTitle:@"카메라 접근 요청"
                                          message:@"카메라 접근 권한이 허용되지 않았습니다.\n'확인' 버튼을 누르시면 접근권한 설정 화면으로 이동합니다."
                                          preferredStyle:UIAlertControllerStyleAlert];
            UIAlertAction *okAction = [UIAlertAction actionWithTitle:@"확인" style:UIAlertActionStyleDefault handler:^(UIAlertAction *action)
                                       {
                [[UIApplication sharedApplication] openURL:[NSURL URLWithString:UIApplicationOpenSettingsURLString]
                                                   options:@{}
                                         completionHandler:nil];
            }];
            
            UIAlertAction *cancelAction = [UIAlertAction actionWithTitle:@"취소" style:UIAlertActionStyleDefault handler:nil];
            
            [alert addAction:okAction];
            [alert addAction:cancelAction];

            UIViewController *rootView = [[[[UIApplication sharedApplication] delegate] window] rootViewController];
            
            while (rootView.presentedViewController) {
                rootView = rootView.presentedViewController;
            }
            
            [rootView presentViewController:alert animated:YES completion:nil];
        }
            break;

        case AVAuthorizationStatusRestricted:{
        };
            break;
    }
    

 

 

 

 

 


The First stage gets high-level functions.
Blocks can be rotated.
Unbreakable will be down.
The next bloc is diappeared. You have to think faster.
UI is changed.
The golden block is able to break all the stuff when It is upper of all of the blocks.
If you touch over 100 times screen, it's possible to pass to the next level. But not 100%.


  NSMutableArray *hjhPowerPack = [[NSMutableArray alloc] init];
  [hjhPowerPack addObject:val]; //1
  [hjhPowerPack addObject:val]; //2
  [hjhPowerPack addObject:val]; //3
.
.
.


  NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
  [userDefaults setObject:nsd forKey:@"hjhPowerPack"]; //1, 2, 3
  [userDefaults synchronize];

    NSUserDefaults *userDefaults = [NSUserDefaults standardUserDefaults];
    NSArray *savedPowerPack = [userDefaults objectForKey:@"hjhPowerPack"];

NSNumber *a = savedPowerPack[0];
NSString *b = savedPowerPack[1];
.............. = savedPowerPack[2];
.
.
.


 NSUserDefaults *u = [NSUserDefaults standardUserDefaults];
    NSArray *hjhPowerPack = [u objectForKey:@"hjhPowerPack"];
    NSString *idis = hjhPowerPack[0];


    NSUserDefaults *u = [NSUserDefaults standardUserDefaults];
    [u removeObjectForKey:@"hjhPowerPack"];
    [u synchronize];



[User Defaults] Attempt to set a non-property-list object
You can only store things like NSArray, NSDictionary, NSString, NSData, NSNumber, and NSDate in NSUserDefaults

https://stackoverflow.com/questions/19720611/attempt-to-set-a-non-property-list-object-as-an-nsuserdefaults/19720674


NSUserDefaults *currentDefaults = [NSUserDefaults standardUserDefaults];
NSData *data = [NSKeyedArchiver archivedDataWithRootObject:yourObject];
[currentDefaults setObject:data forKey:@"yourKeyName"];

NSData *data = [currentDefaults objectForKey:@"yourKeyName"];
yourObjectType * token = [NSKeyedUnarchiver unarchiveObjectWithData:data];

[currentDefaults removeObjectForKey:@"yourKeyName"];

But to implement with primitive type is better.





NSUserDefaults *u = [NSUserDefaults standardUserDefaults];
            [u setObject:GlobalVar.globalVar.globalCDSite forKey:@"udglobalCDSite"];
            [u synchronize];
            




  MVC
  MVP
  MVVM
  VIPER
  Clean Architecture
  Flux

'Blog History' 카테고리의 다른 글

091  (0) 2020.02.24
090  (0) 2020.02.24
088  (0) 2020.02.14
087  (0) 2020.02.14
086  (0) 2020.02.14

+ Recent posts