Symbyoz
  • Documentations
  • News
    • Access to Private and Public S3 bucket
    • Create manual database Backup
    • Parse Live Query on Symbyoz
    • Symbyoz back-office "white mark"
    • Cloud Code is now available in a Console
  • Tutorials
    • How to create a new project
    • How to create a custom module
    • How to manage left menu
    • How to manage admin user rights
  • Source code examples
    • Connect to iOS app
    • Connect to Android app
    • Create & Save Object
    • Get Object
    • Delete Object
    • User Management
    • Queries
    • Subclasses
    • Cloud Code
Powered by GitBook
On this page
  • Simple Way
  • With Callback

Was this helpful?

  1. Source code examples

Create & Save Object

PreviousConnect to Android appNextGet Object

Last updated 6 years ago

Was this helpful?

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 (see more infos on ).

Simple Way

import com.parse.ParseObject;

public void createObject()
{
    ParseObject object = new ParseObject("ClassName");
    // object.put(key, value);
    object.put("age", 37);
    object.put("userName", "John Doe");
    object.put("isFunny", false);
    
    object.saveInBackground();
}
import Parse

class testVC: UIViewController
{
    override func viewDidLoad()
    {
        super.viewDidLoad()
        self.createObjet()
    }


    func createObjet()
    {
        let newObject = PFObject.init(className:"test")
        newObject["TitleA"] = "valueA"
        newObject["isBoolean"] = true
        newObecjt["pointer"] = PFUser.current()        
        newObject.saveInBackground()   
    }
}

With Callback

import com.parse.ParseException;
import com.parse.ParseObject;
import com.parse.SaveCallback;

public void createObject()
{
        ParseObject object = new ParseObject("ClassName");
        // object.put(key, value);
        object.put("age", 37);
        object.put("userName", "John Doe");
        object.put("isFunny", false);

        object.saveInBackground(new SaveCallback()
        {
            @Override
            public void done(ParseException e) 
            {
                
            }
        });
}
import Parse
​
class testVC: UIViewController
{
    override func viewDidLoad()
    {
        super.viewDidLoad()
        self.createObjet()
    }
​
​
    func createObjet()
    {
        let newObject = PFObject.init(className:"test")
        newObject["TitleA"] = "valueA"
        newObject["isBoolean"] = true
        newObecjt["pointer"] = PFUser.current()        
        newObject.saveInBackground(block:
        {
            (isSuccess, error) in
                if let error = error
                {   
                    print (error.localizedDescription)
                }
                else 
                {
                    if (isSuccess)
                    {
                        // Do something                    
                    }
                }
        })
    }
}
Subclasses
this page