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 6372997
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:18:33+00:00 2026-05-25T01:18:33+00:00

OK I found this code here at stackoverflow It works nice. But how can

  • 0

OK I found this code here at stackoverflow It works nice. But how can I call it in a webview from a button on an html page that also has the event details (date time place)?
Programmatically add custom event in the iPhone Calendar

#import "EventTestViewController.h"
#import <EventKit/EventKit.h>

@implementation EventTestViewController

- (void)viewDidLoad {
[super viewDidLoad];

EKEventStore *eventStore = [[EKEventStore alloc] init];

EKEvent *event  = [EKEvent eventWithEventStore:eventStore];
event.title     = @"EVENT TITLE";

event.startDate = [[NSDate alloc] init];
event.endDate   = [[NSDate alloc] initWithTimeInterval:600 sinceDate:event.startDate];

[event setCalendar:[eventStore defaultCalendarForNewEvents]];
NSError *err;
[eventStore saveEvent:event span:EKSpanThisEvent error:&err];       
}



- (void)didReceiveMemoryWarning {
    // Releases the view if it doesn't have a superview.
    [super didReceiveMemoryWarning];

    // Release any cached data, images, etc that aren't in use.
}

- (void)viewDidUnload {
    // Release any retained subviews of the main view.
    // e.g. self.myOutlet = nil;
}


- (void)dealloc {
    [super dealloc];
}

@end
  • 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-05-25T01:18:34+00:00Added an answer on May 25, 2026 at 1:18 am

    You could probably accomplish this by implementing this UIWebViewDelegate method:

    - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
    

    Have your button trigger a POST request containing any form data you want to get out of your web view, extract it from the NSURLRequest object you get back, execute your code, and return NO.

    Let’s say your button is used to submit a form (which it seems like it is). You will need to catch the request your form sends in the delegate method I mentioned, and parse the return value of NSURLRequest’s -HTTPBody method, which will be a string containing the form data from the web view.

    The best way to see what’s going on here is to implement the method and examine the request object in the debugger. This should get you started:

    - (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
    {
        NSLog(@"%@", [request HTTPBody]);
        return NO;
    }
    

    Take a look at the output here, and see what the request body looks like. With a bit of searching you can probably find some code that can make parsing this string more straightforward.

    Another route to take, if you’d rather not get the information from the NSURLRequest, would be to execute some javascript in the web view using -stringByEvaluatingJavaScriptFromString:. If you go that route, you’ll only need to know when the button is pressed, and then you can go in and extract the values using JavaScript.

    One other thing to note is that you will probably want to add a check in your delegate method to make sure you’re intercepting the right request. One way to do this is by looking at the request’s -URL.

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

Sidebar

Related Questions

Any ideas StackOverflow wizards... I have added window.parent.document to the code, this works without
I found this bit of code on stackoverflow at Best practices on displaying search
I've been googling and querying stackoverflow quite a bit but I haven't found this
I found this via google: http://www.mvps.org/access/api/api0008.htm '******************** Code Start ************************** ' This code was
I found this in the code I'm working on at the moment and thought
I've found this piece of code on Koders : private ServiceProvider SiteServiceProvider { get
Edit: This code is fine. I found a logic bug somewhere that doesn't exist
I found this statement is some old code and it took me a second
Reading this question I found this as (note the quotation marks) code to solve
I just found this in some old code, and I'm not sure what it

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.