daily pastebin goal
40%
SHARE
TWEET

Untitled

a guest Jan 18th, 2019 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (NSString *)makeSubmitForm
  2.     {
  3.         NSMutableString *ms = [NSMutableString string];
  4.  
  5.         [ms appendString:@"<p><form action="formentry">"];
  6.         [ms appendString:@"<input style="submit" type="submit" value="Submit" />"];
  7.         [ms appendString:@"<input type="hidden" name="fieldtype" value="submit" />"];
  8.         [ms appendString:@"</form>"];
  9.  
  10.         return ms;
  11.     }
  12.    
  13. - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
  14.     {
  15.         NSString *surl = [[request URL] absoluteString];
  16.  
  17.         NSRange ner = [surl rangeOfString:@"formentry?"];
  18.  
  19.         if (ner.location != NSNotFound){
  20.             NSString *argstr = [surl substringFromIndex:ner.location+ner.length];
  21.             NSMutableDictionary *md = [NSMutableDictionary dictionary];
  22.             NSArray *args = [argstr componentsSeparatedByString:@"&"];
  23.             for (int i=0; i < args.count; i++){
  24.                 NSString *keyval = [args objectAtIndex:i];
  25.                 NSArray *pair = [keyval componentsSeparatedByString:@"="];
  26.                 [md setObject:[pair objectAtIndex:1] forKey:[pair objectAtIndex:0]];
  27.             }
  28.             [MyDelegate tellItWhatever:md];
  29.         }
  30.  
  31.          return NO;
  32.     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top