Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8747103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T12:18:08+00:00 2026-06-13T12:18:08+00:00

I am creating a validate method for my application, hover I am having problems

  • 0

I am creating a validate method for my application, hover I am having problems with the return value;

Incompatible block pointer type sending char …

-(BOOL)validateEmail{

    if (self.ownUser.emailUser != self.emailField) {
        [UserAPIClient validateEmail:self.emailField sucess:^(BOOL sucess, NSError *error) {
            if (sucess) {
                return YES;
            }else{
                NSLog(@"Can´t change e mail, already one is created in the database");
                return NO;
            }
        }];

    }else{
         return YES;
    }
}

Can anybody help me solve this?

Thanks in advance…

EDIT

I completily missed the right solution, just adopt my UserApiClient to return a BOOL

-(BOOL)validateEmail{

if (self.ownUser.emailUser != self.emailField) {

    return [UserAPIClient validateEmail:self.emailField];
}else{
    return YES;
}

}

EDIT 2
Know, i just realized, that i need the result of this method to make some changes after.
How can i change this method to an sync´s Method?

    [[MYApiClient sharedInstance] getPath:@"validateEmail" parameters:params
                                    success:^(AFHTTPRequestOperation *operation, id JSON) {

                                        NSLog(@"SUCESS %@", JSON);
                                    }
                                    failure:^(AFHTTPRequestOperation *operation, NSError *error) {

                                        NSLog(@"Error  %@", error);

                                    }];
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T12:18:10+00:00Added an answer on June 13, 2026 at 12:18 pm

    If you want to use the value of sucess outside of the block, you have to copy it to a __block variable:

    -(BOOL)validateEmail {
    
        if (self.ownUser.emailUser != self.emailField) {
            __block BOOL returnValue;
    
            [User validateEmail:self.emailField sucess:^(BOOL sucess, NSError *error) {
                if (sucess) {
                    returnValue = YES;
                }else{
                    NSLog(@"Can´t change e mail, already one is created in the database");
                    returnValue = NO;
                }
            }];
    
            return returnValue;
    
        } else {
             return YES;
        }
    }
    

    The block itself (as I guess from the prototype) does not return a value.

    Note that this will work only if [User validateEmail:sucess:] works synchronously, so that returnValue is defined when the function call returns.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am creating a method to validate my login fields (user name and password).
Creating a class at runtime is done as follows: klass = Class.new superclass, &block
The scenario: I'm creating a login form for an MVC2 application. How i'm doing
I am creating function (for example) to validate content, then if it is valid,
I have several questions regarding CI application design. Q. When creating a new form
I am developing application having business objects created from EF 4.0. The application is
Suppose I'm creating a class to validate a number, like Social Security in US
OK, i am creating a web application. I am using MVC3. I have ViewModel
I'm creating a registration form using validation inside the User model such as validates_confirmation_of
Creating an a app, where I store bunch of photos in the drawable folder,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.