AVUser 注册时,不会自动添加relation到控制台

AVUser *user = [AVUser user] ;
AVObject *userInfo = [AVObject objectWithClassName:@"userInfo"] ;
[user setObject:userInfo forKey:@"userInfo"] ;
[user signUpInBackground] ;

这样的代码不会在_user中自动添加userInfo[POINTER类型]字段。而官方文档中这样的写法能有parent[POINTER类型]

AVObject *myPost = [AVObject objectWithClassName:@"Post"];
AVObject *myComment = [AVObject objectWithClassName:@"Comment"];
// Add a one-one relation between the Post and Comment
[myComment setObject:myPost forKey:@"parent"];
// This will save both myPost and myComment
[myComment saveInBackground];
阅读 2.3k
1 个回答

上面是signUpInBackground,这是注册接口,下面是saveInBackground,这个才是保存数据的接口

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进