-1

How to Design the Overlay Instructions Above The View?

I HAD 6 buttons....For Each Button I have To show Overlay For That, Before i click on that Button

Suppose... 1) Click button is there...above the Click Button we need to show overlay for click on that button Like That...

**

[I Need Like This Overlay menu over the all Buttons][1]

[1]: https://i.stack.imgur.com/dIjRF.jpg

**

rose lovely
  • 19
  • 1
  • 12
  • are you try for objective-C, or Swift – Anbu.Karthik Mar 03 '16 at 07:42
  • For composing URLs see [`NSURLComponents`](https://developer.apple.com/library/prerelease/ios/documentation/Foundation/Reference/NSURLComponents_class/index.html). For sending requests see [`NSURLSession`](https://developer.apple.com/library/ios/documentation/Foundation/Reference/NSURLSession_class/). For configuring a session see `NSURLSessionConfiguration`. For common tasks and questions about network requests, security, HTTP, etc., ask a _specific_ question. Your question is too broad and not a good fit for SO - and will probably be closed. See also [SO Help](http://stackoverflow.com/help). – CouchDeveloper Mar 03 '16 at 09:15
  • can you update your question once – Anbu.Karthik Mar 03 '16 at 11:55
  • @roselovely -- you nee to like use `Protocol` for your concept, initially fetch User Details and Bank details -- use any NSobjcet or popover controller class, finally use protocol for transfer the value , after that call your webservice it will work , else initially get value of User Details and pass that value to Bank details page and finally call your webservice , it will work – Anbu.Karthik Mar 03 '16 at 12:30
  • @Ajay Singh Thakur ....can u give me solution for this – rose lovely Mar 14 '16 at 09:13
  • @CouchDeveloper....Solution Please – rose lovely Mar 16 '16 at 07:42
  • @Anbu.Karthik....can u give the solution for this link ......http://stackoverflow.com/q/35865691/6011888 – rose lovely Mar 17 '16 at 10:24

4 Answers4

0

Send Parameter to web service using POST method

Below is code to POST data to web service using NSURLConnection.

-(void)postData
{
    NSString *content = [NSString stringWithFormat:@"email=%@&name=%@",textEmail.text,textName.text];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:[NSURL URLWithString:@"your web service url"]];
    [request setHTTPMethod:@"POST"];
    [request setHTTPBody:[content dataUsingEncoding:NSUTF8StringEncoding]];
    [NSURLConnection connectionWithRequest:request delegate:self];
}

- (void)connection:(NSURLConnection *)connection didReceiveData:(NSData *)data
{
    dictJson = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
    NSLog(@"Dict Json :- %@",dictJson);   
}
DJ1
  • 936
  • 15
  • 29
0

Use NSURLSession instead. NSURLConnection is deprecated.

NSString *stringURL = [NSString stringWithFormat:@"%@?term=%@", BASE_URL, _inputText.text];
NSURL *URL = [NSURL URLWithString:stringURL];

NSMutableURLRequest *request = [NSMutableURLRequest requestWithURL:URL];
        [request setHTTPMethod:@"POST"];

NSURLSession *session = [NSURLSession sharedSession];
NSURLSession *session = [NSURLSession sharedSession];
NSURLSessionUploadTask *task = [session uploadTaskWithRequest:request fromData:yourData completionHandler:^(NSData * _Nullable data, NSURLResponse * _Nullable response, NSError * _Nullable error) {
                // Do your stuff here
            }];
Sonic Master
  • 1,238
  • 2
  • 22
  • 36
0

why not use alamofire---

                NSDictionary *parameters = @{
                  @"email":  @"myemail1@mailinator.com",
                  @"password": @"123456789",
                  @"accountnumber": @"LiM6N5gBBmqdlQBJGkqcP0h4OKwGbnzoWFcgTG3Z",
                  @"ifcscode": @"ABC"
                };


                NetworkHandler *networHandler = [NetworkHandler sharedInstance];
    [networHandler composeRequestWithMethod:@"http://example.com/enpoint.json"
                                    paramas: parameters
                               onComplition:^(BOOL success, NSDictionary *response){

                                   if (success) { //handle success response

                                       [self handleLoginResponse:response];
                                   }
                                   else{

                                       ProgressIndicator *pi = [ProgressIndicator sharedInstance];
                                       [pi hideProgressIndicator];
                                   }

                               }];

you can use postman to check your api

0

Pass this two variables of FirstViewController to SecondViewController and then try to put below code in place of your code.

Below is code to POST data using NSURLSession.

I hope this works for you.

-(void)postData
{
    NSString *content = [NSString stringWithFormat:@"Name=%@&Email=%@&A/CName=%@&A/CNumber=%@&IFSCCode=%@&TypeOfAccount=%@",name,email,acName,acNumber,ifscCode,typeOfAccount];
    NSMutableURLRequest *request = [[NSMutableURLRequest alloc]initWithURL:[NSURL URLWithString:@"your web service url"]];
    [request setHTTPMethod:@"POST"];
    [request setHTTPBody:[content dataUsingEncoding:NSUTF8StringEncoding]];

    NSURLSession *session = [NSURLSession sharedSession];
    [[session dataTaskWithURL:[NSURL URLWithString:londonWeatherUrl]
            completionHandler:^(NSData *data,
                          NSURLResponse *response,
                          NSError *error) {

            NSMutableDictionary *dictJson = [NSJSONSerialization JSONObjectWithData:data options:NSJSONReadingMutableContainers error:nil];
            NSLog(@"Dict Json :- %@",dictJson);   

    }] resume];
}
DJ1
  • 936
  • 15
  • 29
  • i want to store three UiviewController's data(1st ViewController Mobile Number , 2nd view controller's name and email and 3rd view controller's bankdetails...) Locally and Hit the API By Sending the All Parameters At A time and clicking on 3rd view controller's register button...b...How can i solve this... – rose lovely Mar 04 '16 at 06:21
  • Try to store all parameters in AppDelegate class and then try to retrieve them in ThirdViewController on click event of any button at time of data Posting. – DJ1 Mar 04 '16 at 06:48
  • How To Store All Parameters in app delegate class...can u please explain step by step – rose lovely Mar 04 '16 at 09:14
  • `YourAppDelegate *appDelegate = (YourAppDelegate *)[[UIApplication sharedApplication] delegate];` `appDelegate.email = tfEmail.text;` – DJ1 Mar 04 '16 at 09:34
  • Please give me some time so i can code and mail it to you. – DJ1 Mar 04 '16 at 11:33
  • Sorry but i have no idea about this. – DJ1 Mar 15 '16 at 05:21