i'm trying to make my first user-registration. The registration will be made by 4 textfields that need to be edited by the user and saved after pushing a button (IBAction). This IBAction needs to be aborted when 1 field is empty. A warning text will be shown to the user and he/she will need to correct the problem before proceeding to save the textdata to a parse server/
I've connected my 4 Uitextfields to the .m script AND i think i've written a good if statement. But how can I stop my script after the warning text?
CODE .M :
- (IBAction)REGISTERNEWUSER:(id)sender
{
//DEFINE STRINGS FOR MODULE
NSString *NICKNAME = Nickname.text;
NSString *USERNAME = Username.text;
NSString *PASSWORD = Password.text;
NSString *EMAIL = Email.text;
NSString *ERRORREGISTRATION = @"Please fill up all fields above before proceeding with the registration...";
//CHECK IF ALL REGISTRATION FIELDS ARE FILLED
if ([Nickname.text length] > 0 || [Username.text length] > 0 || [Password.text length] > 0 || [Email.text length] > 0 )
{
}
ErrorRegistration.text = ERRORREGISTRATION;
//
// METHODE NEEDS TO STOP HERE
// BUT AT MOMENT CONTINUES TO SEND DATA TO PARSE
//
{
}
//SEND DATA TO PARSE SERVER
PFObject *User = [PFObject objectWithClassName:@"USER"];
[User setValue:NICKNAME forKey:@"Nickname"];
[User setValue:USERNAME forKey:@"Username"];
[User setValue:PASSWORD forKey:@"Password"];
[User setValue:EMAIL forKey:@"Email"];
[User save];
}
Thanks in advance for any help provided. Kind Regards, Lien.