Tuesday, October 6, 2026
HomeiOS DevelopmentGoal C | Property modifications itself

Goal C | Property modifications itself

[ad_1]

I’ve code:

-(NSString*)callApiLogin:(NSString*)electronic mail
                   :(NSString*)password {
    
    //Name api, I eliminated it right here

    [urlRequest setHTTPMethod:@"POST"];
    [urlRequest setHTTPBody:postData];

    NSURLSessionDataTask *dataTask = [defaultSession dataTaskWithRequest:urlRequest completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
        
        @try {
            NSString* dataToJson = [[NSString alloc] initWithData:knowledge encoding:NSUTF8StringEncoding];
            
            __block BOOL ifJsonSuccessedA = [self validateApiLogin:dataToJson];
            if (ifJsonSuccessedA) {
                self.ifSuccessedLogin = @"YES"; //I ponder, why at this case, ifsuccessedlogin equals YES...
            } else {
                self.ifSuccessedLogin = @"NO";
            }
        } @catch (NSException *exception) {
            NSLog(@"Error");
        } @lastly {
            return;
        }
        
    }];
    [dataTask resume];

    return [self ifSuccessedLogin]; //...however right here it is nil
}

The issue is described in feedback. I ponder, why contained in the operate, self.ifSuccessedLogin equals to YES, however the operate returns nil.

[ad_2]

RELATED ARTICLES

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Most Popular

Recent Comments