Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

你好 #10

Open
393821015 opened this issue Dec 21, 2015 · 1 comment
Open

你好 #10

393821015 opened this issue Dec 21, 2015 · 1 comment

Comments

@393821015
Copy link

我在项目中注册的用户名是一段字符 (例如 小灰_112);现在我展示的headerViwe的时候名字可以改成小灰;发表状态时的用户名也可替换成小灰,但是点赞和评论的时候发现不只是改了移动端,我后台表里面的userName字段也被修改成小灰了,这个问题应该怎么避免啊,已经调试了一天了,很急,谢谢了

@393821015
Copy link
Author

/*!

  • 填充 username,createdAt 等数据
    */
  • (void)fillPointerUser:(AVUser *)pointerUser {
    AVUser *fullUser = [self lookUpUserById:pointerUser.objectId];
    //为了去掉用户名后边的id值,--begin--
    NSString *temp =fullUser.username;
    //NSLog(@"-----digname:---%@--------",temp);
    NSArray *strArr = [temp componentsSeparatedByString:@"_"];
    fullUser.username=strArr[0];
    //为了去掉用户名后边的id值,--end--
    [pointerUser objectFromDictionary:[fullUser dictionaryForObject]];
    }
    我在这个方法里改了展示的名字
    然后发现点赞时
  • (void)digOrCancelDigOfAlbum:(LCAlbum *)album block:(AVBooleanResultBlock)block {
    AVUser *user = [AVUser currentUser];
    if ([album.digUsers containsObject:user]) {
    [album removeObject:user forKey:KEY_DIG_USERS];
    } else {
    [album addObject:user forKey:KEY_DIG_USERS];
    }
    [album saveInBackgroundWithBlock:block];
    }
    又重新调用了saveInBackgroundWithBlock又把名字重新赋值了
    现在乱了 ,指点一下看看怎么能把这个避免过去呢

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant