yiyie1 / TalknicApp

Talknic prototype
http://talknic.cn
2 stars 1 forks source link

Backlog / TODO #7

Open yiyie1 opened 8 years ago

yiyie1 commented 8 years ago
  1. why below code does't work on ipad mini ? ios 9.0

-(void)actionSheet:(UIActionSheet *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex { TalkLog(@"buttonIndex = [%ld]",(long)buttonIndex); switch (buttonIndex) { case 0://照相机

    {
        UIImagePickerController *imagePicker = [[UIImagePickerController alloc]init];
        imagePicker.delegate = self;
        imagePicker.allowsEditing = YES;
        imagePicker.sourceType = UIImagePickerControllerSourceTypeCamera;
        [self presentViewController:imagePicker animated:YES completion:nil];
    }

        break;
    case 1://本地相册
    {
        UIImagePickerController *imagePicker = [[UIImagePickerController alloc]init];
        imagePicker.delegate = self;
        imagePicker.allowsEditing = YES;
        imagePicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
        [self presentViewController:imagePicker animated:YES completion:nil];

    }
        break;
    default:
        break;
}
yiyie1 commented 8 years ago

2 Replace below code with ViewControllerUtil SetTitle;

UILabel *title = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 100, 44)];

title.text = AppCoupon;

title.textAlignment = NSTextAlignmentCenter;

title.textColor = [UIColor colorWithRed:255/255.0 green:255/255.0 blue:255/255.0 alpha:1.0];
title.font = [UIFont fontWithName:kHelveticaRegular size:17.0];

self.navigationItem.titleView = title;
yiyie1 commented 8 years ago

3 Code refactor: Move all of below AFNetwork code to ViewControllerUtil;

AFHTTPSessionManager session = [AFHTTPSessionManager manager]; session.responseSerializer.acceptableContentTypes = [NSSet setWithObject:@"text/html"]; NSMutableDictionary parme = [NSMutableDictionary dictionary]; parme[@"cmd"] = @"19"; parme[@"user_id"] = _uid; TalkLog(@"Me ID -- %@",_uid); [session POST:PATH_GET_LOGIN parameters:parme progress:^(NSProgress * _Nonnull uploadProgress) {

} success:^(NSURLSessionDataTask * _Nonnull task, id  _Nullable responseObject) {
    TalkLog(@"Me result: %@",responseObject);
    dic = [solveJsonData changeType:responseObject];
    if (([(NSNumber *)[dic objectForKey:@"code"] intValue] == 2))
    {

    }
    else if (([(NSNumber *)[dic objectForKey:@"code"] intValue] == 4))
    {
        [MBProgressHUD showError:kAlertIDwrong];
        return;
    }
    else if (([(NSNumber *)[dic objectForKey:@"code"] intValue] == 3))
    {
        [MBProgressHUD showError:kAlertdataFailure];
        return;
    }

} failure:^(NSURLSessionDataTask * _Nullable task, NSError * _Nonnull error) {
    [MBProgressHUD showError:kAlertNetworkError];
    return;
}];
yiyie1 commented 8 years ago

4 clean up self.var and _var in the code.

yiyie1 commented 8 years ago

5 基于目前的数据表在增加新的数据字段后,再使用函数save存储该字段数据时会失败;WA是新建表