확인이 코드는 여기에 stackoverflow에서 찾았습니다. 좋은 작동합니다. 하지만 어떻게 이벤트 정보 (날짜 시간 장소)가있는 html 페이지의 단추에서 webview로 호출 할 수 있습니까?어떻게 html 버튼 에서이 코드를 호출하고 매개 변수를 전달합니까
이- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
당신의 버튼을 사용하여 웹보기 나가야 할 어떤 형태의 데이터를 포함하는 POST 요청을 트리거 가지고, 그것을 추출 : 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) 저에게 많은 믿음을 가져 주셔서 감사합니다.하지만 NSURLRequest 추출물에 대한 지침서를 가르쳐 주시겠습니까? 2) 동일한 코드를 호출하지만 다른 매개 변수를 보내는 버튼이 여러 개있는 경우 어떻게 작동합니까? 버튼은 html 페이지에 있습니다. – Rick
내 답변이 몇 가지 추가 조언으로 업데이트되었습니다. –
ok cool 시도해보기 – Rick