xcode - 如何将新值附加到解析数据库中已有的值?

标签 xcode swift parse-platform

我在 parse.com 数据库中有一个名为 test 的表。我其中有一个名为电话号码的列。因此,我成功地在列中插入了一个值(例如 123456789),现在我想在同一字段中附加另一个值。 (例如 123456789,987654321)我该怎么做?我同时使用 Parse 和 Xcode。我使用的语言是 swift。

最佳答案

我知道它是 Swift,但你可以在 Objective-c 中这样做,(我确信它接近 swift 版本):

PFQuery *query = [PFQuery queryWithClassName:@"className"];
[query getFirstObjectInBackgroundWithBlock:^(PFObject *object, NSError *error) {

  if (object) {

 // let's update your phone number
    NSString *numbers = @"123";
    NSString *newStr = [NSString stringWithFormat:@"%@ %@ ",object[@"telNumber"], numbers]
    object[@"telNumber"] = newStr;
    [object saveInBackground];
}

}];

关于xcode - 如何将新值附加到解析数据库中已有的值?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34237649/

相关文章:

Xcode 10 中的 iOS 9.3 模拟器

iphone - 具有分页和来自 NSMutableArray 的数据的动态 UIScrollView

Swift - 如何按时间间隔在 UITextfield 中保存输入的信息?

ios - 保存任何未保存的 PFObject 甚至用户终止应用程序

iOS 解析如何通过 URL 下载文件

ios - 升级到 xcode 4.6 和 iOS 6.1 后出错 "used as the name of the previous parameter rather than as part of the selector"

xcode - 如何使用命令行提取xip存档?

swift - 在 SwiftUI 中操作绑定(bind)变量

ios - RestKit、CoreData 和 Swift - 我似乎无法取回结果

ios - 如何检索不是当前用户的 PFUser 的电子邮件?