Create & Save Object
Storing data on Symbyoz is built around Parse and his ParseObject. Each ParseObjectcontains key-value pairs of JSON-compatible data. This data is schemaless, which means that you don’t need to specify ahead of time what keys exist on each ParseObject.
If you want to have a structured model of your object, you can do it so by registering what we call Subclasses (see more infos on this page).

Simple Way

Java
Swift
1
import com.parse.ParseObject;
2
3
public void createObject()
4
{
5
ParseObject object = new ParseObject("ClassName");
6
// object.put(key, value);
7
object.put("age", 37);
8
object.put("userName", "John Doe");
9
object.put("isFunny", false);
10
11
object.saveInBackground();
12
}
Copied!
1
import Parse
2
3
class testVC: UIViewController
4
{
5
override func viewDidLoad()
6
{
7
super.viewDidLoad()
8
self.createObjet()
9
}
10
11
12
func createObjet()
13
{
14
let newObject = PFObject.init(className:"test")
15
newObject["TitleA"] = "valueA"
16
newObject["isBoolean"] = true
17
newObecjt["pointer"] = PFUser.current()
18
newObject.saveInBackground()
19
}
20
}
Copied!

With Callback

Java
Swift
1
import com.parse.ParseException;
2
import com.parse.ParseObject;
3
import com.parse.SaveCallback;
4
5
public void createObject()
6
{
7
ParseObject object = new ParseObject("ClassName");
8
// object.put(key, value);
9
object.put("age", 37);
10
object.put("userName", "John Doe");
11
object.put("isFunny", false);
12
13
object.saveInBackground(new SaveCallback()
14
{
15
@Override
16
public void done(ParseException e)
17
{
18
19
}
20
});
21
}
Copied!
1
import Parse
2
3
class testVC: UIViewController
4
{
5
override func viewDidLoad()
6
{
7
super.viewDidLoad()
8
self.createObjet()
9
}
10
11
12
func createObjet()
13
{
14
let newObject = PFObject.init(className:"test")
15
newObject["TitleA"] = "valueA"
16
newObject["isBoolean"] = true
17
newObecjt["pointer"] = PFUser.current()
18
newObject.saveInBackground(block:
19
{
20
(isSuccess, error) in
21
if let error = error
22
{
23
print (error.localizedDescription)
24
}
25
else
26
{
27
if (isSuccess)
28
{
29
// Do something
30
}
31
}
32
})
33
}
34
}
Copied!
Copy link