Register Bmob Account
Enter www.bmob.cn in the URL field or in the Baidu input bmob to search, open Bmob official website, click on the top right corner of the "registration", in the jump page fill in your name, email, set the password, confirm to your mailbox activation Bmob account, you can use bmob easy to develop the application
Site Background Create app
After entering the Bmob backstage, click "Create App" in the upper left corner of the background screen, enter the name of your app in the pop-up box, then confirm that you have an app waiting to be developed.
Get the app key and download the SDK
Select the app you want to develop and click on the app key below the app
After the import effect is as follows:
Set the Bmobkey for your app
A test: Upload a test of a name password and a picture
Create a button associated event:
UIButton *button = [UIButton Buttonwithtype:uibuttontypesystem]; [Button settitle:@ "send" forstate:uicontrolstatenormal]; Button.bounds = CGRectMake (0, 0, +); Button.center = Self.view.center; [Button addtarget:self action: @selector (buttonpressed:) forcontrolevents:uicontroleventtouchupinside]; [Self.view Addsubview:button];
-(void) buttonpressed: (UIButton *) Sender { [self createbmobobject];// [self adduserinfo];}
-(void) createbmobobject{//Toward Gamescore table add a playername for Xiaoming, score 78 for data Bmobobject * Gamescore = [Bmobobject objectwithclassname:@ "userinformation"]; [Gamescore setobject:@ "Your name" forkey:@ "name"]; [Gamescore setobject:@ "123" forkey:@ "password"]; [Gamescore saveinbackgroundwithresultblock:^ (BOOL issuccessful, Nserror *error) {if (issuccessful) {NSLog (@ "Success"); }else {NSLog (@ "failed"); } }]; NSBundle *bundle = [NSBundle mainbundle]; Local picture NSString *filestring = [NSString stringwithformat:@ "%@/image1.jpg", [bundle Bundlepath]]; Bmobfile *file = [[Bmobfile alloc] initwithfilepath:filestring]; [File saveinbackground:^ (BOOL issuccessful, Nserror *error) {if (issuccessful) {[Gamescore setobject:file forkey:@ "Logimage"]; [Gamescore Updateinbackground]; NSLog (@ "Success"); }} withprogressblock:^ (float progress) {}];}
Effect:
Preliminary use of Bmob