NSString, NSURLRequest,

NSString* abc;
[abc hasSubstr:@""];

static NSString* kLoginAPI = @"%@/api/rest";
apiURL = [NSString stringWithFormat:kLoginAPI, networkAddress];

Foundation.h
\- NSURLRequest.h
\- setHTTPMethod:(NSString *)method;


CVAPIRequest: NSMutableURLRequest
@implement CVAPIRequest
- (id)initWithCommand: (NSString*) command andApiPath(NSString*) {
...
...
...
[self setHTTPMethod:@"POST"];
[self setValue:];
}
#import CVAPIUtil.h

CVAPIUtil.h
static NSString* kAPICommandValue = @"V100 cmd=%@, format=JSON, version=1.0 ";

 

CVBaseLoginView

- (void)loginWithNetwork:(NSString*)address username:(NSString *)username password:(NSString *)password {
    request = NSMutableRequest
    param = NSDictionary dictionaryWithObjectsAndKeys
    NSString* jsonRequest = [param jsonValue];
    [request setParamString:jsonRequest];
    CVAPIRequestModel* model = [[CVAPIRequestModel alloc] init];
    [model sendRequest:request completion:^(NSDictionary* apiResult, NSError* error) {
        _signInButton.enabled = YES;
        _signUpButton.enabled = YES;
        _requestPasswordButton.enabled = YES;
        _resetPasswordButton.enabled = YES;
        _activateSignUpButton.enabled = YES;
        [_activityIndicator stopAnimating];
        [_activityIndicator2 stopAnimating];
        [_activityIndicator3 stopAnimating];
        [_activityIndicator4 stopAnimating];
    }];   
}
Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s