Iphone 中的股票图表?

发布于 2024-11-06 12:30:20 字数 155 浏览 0 评论 0原文

我正在使用图形应用程序。在其中,我必须实现股票图形以通过网络服务获取数据。那么您能否建议我有关 Iphon/Ipad 中图形的任何令人印象深刻的 SDK 或 API。我正在尝试使用 Roambi,但我不认为它更多有用。我使用了核心图库和类别线图。但是除了这个之外还有其他方法吗?所以请你建议我吗?

I am working with Graph application.In it I have to implement Stock Graphs for fatching datas via webservice.So would you suggest me about any impressive SDK or API for Graphs in Iphon/Ipad.I was trying with Roambi but I dont think its more useful.I used Core plot Library and Categoty Line Graphs.But is there other way for that instead of this?So please would you suggest me?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

天冷不及心凉 2024-11-13 12:30:20

您是否查看过 Core Plot 框架内部附带的示例应用程序? AAPLot 示例应用程序是一个股票图表应用程序,模仿 Apple 内置股票应用程序的风格(添加了一些内容,例如成交量图表和交易范围):

替代文字
(来源:sunsetlakesoftware.com

Core Plot 甚至有一个名为 kCPStocksTheme 的主题,它具有这种确切的风格。我不知道还能比这容易多少。

Did you look inside the Core Plot framework to see the sample applications that ship with it? The AAPLot sample application is a stock charting application that mimics the style of Apple's built-in Stocks application (with a few additions, like volume charting and trading ranges):

alt text
(source: sunsetlakesoftware.com)

Core Plot even has a theme called kCPStocksTheme that does this exact style. I don't know how much easier it can get than that.

霓裳挽歌倾城醉 2024-11-13 12:30:20
#import <UIKit/UIKit.h>
#import <EventKit/EventKit.h>
#import <EventKitUI/EventKitUI.h>

@interface DueDate : UITableViewController <UINavigationBarDelegate,UITableViewDelegate,UITableViewDataSource,EKEventEditViewDelegate,UINavigationControllerDelegate,UIActionSheetDelegate>{

    EKEventViewController *detailViewController;
    EKEventStore *eventStore;
    EKCalendar *defaultCalendar;

    NSMutableArray *eventsList;
}

@property (nonatomic,retain) EKEventViewController *detailViewController;
@property (nonatomic,retain) EKEventStore *eventStore;
@property (nonatomic,retain) EKCalendar *defaultCalendar;
@property (nonatomic,retain) NSMutableArray *eventsList;

-(NSArray *)fetchEventsForToday;
- (IBAction) addEvent:(id)sender;

@end



#import "DueDate.h"


@implementation DueDate
@synthesize detailViewController,eventStore,defaultCalendar,eventsList;

- (void)dealloc {
    [eventStore release];
    [eventsList release];
    [defaultCalendar release];
    [detailViewController release];

    [super dealloc];
}

-(void)viewDidLoad{
    self.title = @"Remind Me";

    self.eventStore = [[EKEventStore alloc] init];

    self.eventsList = [[NSMutableArray alloc] initWithArray:0];

    self.defaultCalendar = [self.eventStore defaultCalendarForNewEvents];
    UIBarButtonItem *addButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addEvent:)];
    self.navigationItem.rightBarButtonItem = addButtonItem;
    [addButtonItem release];

    self.navigationController.delegate = self;

    [self.eventsList addObjectsFromArray:[self fetchEventsForToday]];
    [self.tableView reloadData];
}

-(void)viewDidUnload{
    self.eventsList = nil;
}

-(void)viewWillAppear:(BOOL)animated{
    [self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:NO];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

-(NSArray *)fetchEventsForToday{
    NSDate *startDate = [NSDate date];

    NSDate *endDate = [NSDate dateWithTimeIntervalSinceNow:86400];

    NSArray *calendarArray = [NSArray arrayWithObject:defaultCalendar];

    NSPredicate *predicate = [self.eventStore predicateForEventsWithStartDate:startDate endDate:endDate calendars:calendarArray];

    NSArray *events = [self.eventStore eventsMatchingPredicate:predicate];

    return events;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [eventsList count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    static NSString *CellIdentifier = @"Cell";

    UITableViewCellAccessoryType editableCellAccessoryType = UITableViewCellAccessoryDisclosureIndicator;

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease];        
    }

    cell.accessoryType = editableCellAccessoryType;

    cell.textLabel.text = [[self.eventsList objectAtIndex:indexPath.row] title];

    return cell;    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    self.detailViewController = [[EKEventViewController alloc] initWithNibName:nil bundle:nil];
    detailViewController.event = [self.eventsList objectAtIndex:indexPath.row];

    detailViewController.allowsEditing = YES;

    [self.navigationController pushViewController:detailViewController animated:YES];
}

- (void)navigationController:(UINavigationController *)navigationController 
      willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
    if (viewController == self && self.detailViewController.event.title == NULL) {
        [self.eventsList removeObject:self.detailViewController.event];
        [self.tableView reloadData];
    }
}

- (void)eventEditViewController:(EKEventEditViewController *)controller didCompleteWithAction:(EKEventEditViewAction)action{

    NSError *error = nil;
    EKEvent *thisEvent = controller.event;

    switch (action) {
        case EKEventEditViewActionCanceled:
             break;

        case EKEventEditViewActionSaved:
            if (self.defaultCalendar == thisEvent.calendar) {
                [self.eventsList addObject:thisEvent];
            }
            [controller.eventStore saveEvent:controller.event span:EKSpanThisEvent error:&error]; 
            [self.tableView reloadData];
            break;
        case EKEventEditViewActionDeleted:
            if (self.defaultCalendar == thisEvent.calendar) {
                [self.eventsList removeObject:thisEvent];
            }
            [controller.eventStore removeEvent:thisEvent span:EKSpanThisEvent error:&error];
            [self.tableView reloadData];
            break;

        default:
            break;
    }
    [controller dismissModalViewControllerAnimated:YES];
}

- (EKCalendar *)eventEditViewControllerDefaultCalendarForNewEvents:(EKEventEditViewController *)controller{
    EKCalendar *calendarForEdit = self.defaultCalendar;
    return calendarForEdit;
}

- (void) addEvent:(id)sender{
    EKEventEditViewController *addController = [[EKEventEditViewController alloc] initWithNibName:nil bundle:nil];
    addController.eventStore = self.eventStore;
//    [self presentModalViewController:addController animated:YES];
    [self presentModalViewController:addController animated:YES];

    addController.editViewDelegate = self;
    [addController release];
}



@end




#import <UIKit/UIKit.h>


@interface HomePageWebViewController : UIViewController <UIWebViewDelegate>{
    IBOutlet UIWebView *webView;
    IBOutlet UIActivityIndicatorView *loadingIndicator;
    NSURL *contenturl;
}
-(void)setNavigationTitle:(NSString *)title;
-(void)setURL:(NSURL *)url;

@end


#import "HomePageWebViewController.h"


@implementation HomePageWebViewController
-(void)setURL:(NSURL *)url{
    contenturl = url;
}
-(void)setNavigationTitle:(NSString *)title{
    self.title = title;
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

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

- (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.
}

#pragma mark WEBVIEW DELEGATE

- (void)webViewDidStartLoad:(UIWebView *)webView{
    [loadingIndicator startAnimating];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
    [loadingIndicator stopAnimating];

}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
    [loadingIndicator stopAnimating];

}
#pragma mark - View lifecycle

/*
 // Implement loadView to create a view hierarchy programmatically, without using a nib.
 - (void)loadView
 {
 }
 */

/*
 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
 - (void)viewDidLoad
 {
 [super viewDidLoad];
 }
 */
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [loadingIndicator startAnimating];
    [webView loadRequest:[NSURLRequest requestWithURL:contenturl]];
}

-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    if([webView isLoading]){
        [webView stopLoading];
    }
}

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

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end


#import <UIKit/UIKit.h>
#import <MessageUI/MFMailComposeViewController.h>



@interface MainMenuViewController : UIViewController <UITableViewDelegate,UITableViewDataSource,UIPickerViewDelegate,UIPickerViewDataSource,MFMailComposeViewControllerDelegate> {

    NSMutableArray *aryProfessions;
    NSMutableArray *aryMainMenuItems;
//    NSMutableArray *barItems;

    IBOutlet UIPickerView *pkrProfession;
    IBOutlet UIToolbar *toolBar;
    IBOutlet UIBarButtonItem *btnDone;
    IBOutlet UIBarButtonItem *btnCancel;

    MFMailComposeViewController *controller;

    NSInteger _selIndex;
}

@property (nonatomic, assign) NSInteger selIndex;

- (IBAction)selectAnItem:(id)sender;
- (IBAction)itemNotSelected:(id)sender;


@end


#import "MainMenuViewController.h"
#import "HomePageWebViewController.h"
#import "DueDate.h"


@implementation MainMenuViewController
@synthesize selIndex = _selIndex;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

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

- (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.
}

#pragma mark - View lifecycle


- (void)viewWillAppear:(BOOL)animated
{
    self.title = @"ChiroCredit Main Menu";




    [pkrProfession setHidden:YES];
    [toolBar setHidden:YES];
    [btnDone setEnabled:NO];



    aryMainMenuItems = [[NSMutableArray alloc] initWithObjects:@"ChiroCredit Home Page",@"Countinuing Education Courses",@"Continuing Education FAQ's",@"Contact US",@"Remind me when Credits are Due",nil];

    aryProfessions = [[[NSMutableArray alloc] initWithObjects:@"Please Select Anyone Course",
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Aromatherapy",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=27",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Athletic Trainer",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=14",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Boundary Training",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=25",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Chiropractic Assistant",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=3",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Chiropractic Doctor",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=1",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Chiropractic Student",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=2",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Hand Therapist",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=4",@"url",nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Holistic Health Counselor",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=28",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Legal Secretary/Word Processor",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=34",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Massage Therapy",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=22",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Medical Doctor",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=32",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Naturopath",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=24",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Nursing",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=26",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Occupational Therapist",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=19",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"OT Assistant",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=21",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Other Florida Professionals",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=35",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Physical Therapist",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=18",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"PT Assistant",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=20",@"url", nil],
                       nil] retain];
    NSLog(@"array count is:- %i",[aryProfessions count]);
//    [pkrProfession reloadComponent:0];
    [self.view reloadInputViews];
    [super viewWillAppear:YES];
    // Do any additional setup after loading the view from its nib.
}


// Customize the number of sections in the table view.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [aryMainMenuItems count];
}

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

    cell.textLabel.font=[UIFont systemFontOfSize:16.0f];
    cell.textLabel.font=[UIFont boldSystemFontOfSize:16.0f];
    cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    cell.textLabel.text = [aryMainMenuItems objectAtIndex:indexPath.row];
    return cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {
        HomePageWebViewController *objHomePage = [[HomePageWebViewController alloc] initWithNibName:@"HomePageWebViewController" bundle:nil];
        [objHomePage setNavigationTitle:@"ChiroCredit"];
        [objHomePage setURL:[NSURL URLWithString:@"http://www.chirocredit.com/"]];
        [self.navigationController pushViewController:objHomePage animated:YES];
    }
    else if(indexPath.row == 1){
        [toolBar setHidden:NO];
//        barItems = [[NSMutableArray alloc] init];
//        
//        UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 72, 0)];
//        [lbl setTextAlignment:UITextAlignmentCenter];
//        NSString *strLabel = @"Please Select any one course";
//        lbl.text=strLabel;
//        lbl.textColor=[UIColor whiteColor];
//        
//        UIBarButtonItem *lblBtn = [[UIBarButtonItem alloc] initWithCustomView:lbl];
//        [lbl release];
//        
//        [barItems addObject:btnCancel];
//        [barItems addObject:lblBtn];
//        [barItems addObject:btnDone];
//        [toolBar setItems:barItems animated:YES];
//        [toolBar addSubview:lbl];
        [pkrProfession setHidden:NO];
    }
    else if(indexPath.row == 2){
        HomePageWebViewController *objHomePage = [[HomePageWebViewController alloc] initWithNibName:@"HomePageWebViewController" bundle:nil];
        [objHomePage setNavigationTitle:@"Continuing Education FAQ's"];
        [objHomePage setURL:[NSURL URLWithString:@"http://www.chirocredit.com/pages/faqs.php"]];
        [self.navigationController pushViewController:objHomePage animated:YES];
    }
    else if(indexPath.row == 3){
        NSArray *array1 = [[NSArray alloc]initWithObjects:@"[email protected]",nil];
        controller = [[MFMailComposeViewController alloc]init];
        controller.mailComposeDelegate = self;  
        [controller setSubject:@"Contact Online CE"];
        [controller setToRecipients:array1];
        NSString *emailBody = @" ";
        [controller setMessageBody:emailBody isHTML:NO];
        [self presentModalViewController:controller animated:YES];
        [controller release];
    }
    else{
        DueDate *objDueDate = [[DueDate alloc] initWithNibName:@"DueDate" bundle:nil];
        [self.navigationController pushViewController:objDueDate animated:YES];
    }    
}
- (void)mailComposeController:(MFMailComposeViewController*)controller  
          didFinishWithResult:(MFMailComposeResult)result 
                        error:(NSError*)error
{
    if (result == MFMailComposeResultSent) {
        NSLog(@"Mail Sent...!");

        UIAlertView *mailSend=[[UIAlertView alloc] initWithTitle:@"Email Sender" message:@"Mail has been sent.." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
        [mailSend show];
        [mailSend release];        
    }
    if (MFMailComposeResultCancelled) {
        [self.navigationController popViewControllerAnimated:YES];
    }
    [self dismissModalViewControllerAnimated:YES];
}

//PICKER VIEW DELEGATES....

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView {

    return 1;
}

- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component {


    return [aryProfessions count];

}



- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {

    if (row==0){
        return [NSString stringWithFormat:@"Please Select Anyone Course"];
    }
    else{
        return [[aryProfessions objectAtIndex:row]valueForKey:@"title"];
    }
    return nil;


}



- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {

    if (row == 0) {
        [btnDone setEnabled:NO];
    }
    else{
        [btnDone setEnabled:YES];
    }
     self.selIndex = row;
    if (self.selIndex == 0) {
        [btnDone setEnabled:NO];
    }
    else{
        [btnDone setEnabled:YES];
    }    
}

- (IBAction)selectAnItem:(id)sender {
    if (self.selIndex != 0) {
        NSDictionary *dicRow = [aryProfessions objectAtIndex:self.selIndex];
        HomePageWebViewController *objProfession = [[HomePageWebViewController alloc] initWithNibName:@"HomePageWebViewController" bundle:nil];
        [objProfession setNavigationTitle:[dicRow objectForKey:@"title"]];
        [objProfession setURL:[NSURL URLWithString:[dicRow objectForKey:@"url"]]];
        [self.navigationController pushViewController:objProfession animated:YES];
        [dicRow release];
    }

}

- (IBAction)itemNotSelected:(id)sender{
    [toolBar setHidden:YES];
    [pkrProfession setHidden:YES];
}


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

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
#import <UIKit/UIKit.h>
#import <EventKit/EventKit.h>
#import <EventKitUI/EventKitUI.h>

@interface DueDate : UITableViewController <UINavigationBarDelegate,UITableViewDelegate,UITableViewDataSource,EKEventEditViewDelegate,UINavigationControllerDelegate,UIActionSheetDelegate>{

    EKEventViewController *detailViewController;
    EKEventStore *eventStore;
    EKCalendar *defaultCalendar;

    NSMutableArray *eventsList;
}

@property (nonatomic,retain) EKEventViewController *detailViewController;
@property (nonatomic,retain) EKEventStore *eventStore;
@property (nonatomic,retain) EKCalendar *defaultCalendar;
@property (nonatomic,retain) NSMutableArray *eventsList;

-(NSArray *)fetchEventsForToday;
- (IBAction) addEvent:(id)sender;

@end



#import "DueDate.h"


@implementation DueDate
@synthesize detailViewController,eventStore,defaultCalendar,eventsList;

- (void)dealloc {
    [eventStore release];
    [eventsList release];
    [defaultCalendar release];
    [detailViewController release];

    [super dealloc];
}

-(void)viewDidLoad{
    self.title = @"Remind Me";

    self.eventStore = [[EKEventStore alloc] init];

    self.eventsList = [[NSMutableArray alloc] initWithArray:0];

    self.defaultCalendar = [self.eventStore defaultCalendarForNewEvents];
    UIBarButtonItem *addButtonItem = [[UIBarButtonItem alloc] initWithBarButtonSystemItem:UIBarButtonSystemItemAdd target:self action:@selector(addEvent:)];
    self.navigationItem.rightBarButtonItem = addButtonItem;
    [addButtonItem release];

    self.navigationController.delegate = self;

    [self.eventsList addObjectsFromArray:[self fetchEventsForToday]];
    [self.tableView reloadData];
}

-(void)viewDidUnload{
    self.eventsList = nil;
}

-(void)viewWillAppear:(BOOL)animated{
    [self.tableView deselectRowAtIndexPath:self.tableView.indexPathForSelectedRow animated:NO];
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
}

-(NSArray *)fetchEventsForToday{
    NSDate *startDate = [NSDate date];

    NSDate *endDate = [NSDate dateWithTimeIntervalSinceNow:86400];

    NSArray *calendarArray = [NSArray arrayWithObject:defaultCalendar];

    NSPredicate *predicate = [self.eventStore predicateForEventsWithStartDate:startDate endDate:endDate calendars:calendarArray];

    NSArray *events = [self.eventStore eventsMatchingPredicate:predicate];

    return events;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return [eventsList count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    static NSString *CellIdentifier = @"Cell";

    UITableViewCellAccessoryType editableCellAccessoryType = UITableViewCellAccessoryDisclosureIndicator;

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier]autorelease];        
    }

    cell.accessoryType = editableCellAccessoryType;

    cell.textLabel.text = [[self.eventsList objectAtIndex:indexPath.row] title];

    return cell;    
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
    self.detailViewController = [[EKEventViewController alloc] initWithNibName:nil bundle:nil];
    detailViewController.event = [self.eventsList objectAtIndex:indexPath.row];

    detailViewController.allowsEditing = YES;

    [self.navigationController pushViewController:detailViewController animated:YES];
}

- (void)navigationController:(UINavigationController *)navigationController 
      willShowViewController:(UIViewController *)viewController animated:(BOOL)animated {
    if (viewController == self && self.detailViewController.event.title == NULL) {
        [self.eventsList removeObject:self.detailViewController.event];
        [self.tableView reloadData];
    }
}

- (void)eventEditViewController:(EKEventEditViewController *)controller didCompleteWithAction:(EKEventEditViewAction)action{

    NSError *error = nil;
    EKEvent *thisEvent = controller.event;

    switch (action) {
        case EKEventEditViewActionCanceled:
             break;

        case EKEventEditViewActionSaved:
            if (self.defaultCalendar == thisEvent.calendar) {
                [self.eventsList addObject:thisEvent];
            }
            [controller.eventStore saveEvent:controller.event span:EKSpanThisEvent error:&error]; 
            [self.tableView reloadData];
            break;
        case EKEventEditViewActionDeleted:
            if (self.defaultCalendar == thisEvent.calendar) {
                [self.eventsList removeObject:thisEvent];
            }
            [controller.eventStore removeEvent:thisEvent span:EKSpanThisEvent error:&error];
            [self.tableView reloadData];
            break;

        default:
            break;
    }
    [controller dismissModalViewControllerAnimated:YES];
}

- (EKCalendar *)eventEditViewControllerDefaultCalendarForNewEvents:(EKEventEditViewController *)controller{
    EKCalendar *calendarForEdit = self.defaultCalendar;
    return calendarForEdit;
}

- (void) addEvent:(id)sender{
    EKEventEditViewController *addController = [[EKEventEditViewController alloc] initWithNibName:nil bundle:nil];
    addController.eventStore = self.eventStore;
//    [self presentModalViewController:addController animated:YES];
    [self presentModalViewController:addController animated:YES];

    addController.editViewDelegate = self;
    [addController release];
}



@end




#import <UIKit/UIKit.h>


@interface HomePageWebViewController : UIViewController <UIWebViewDelegate>{
    IBOutlet UIWebView *webView;
    IBOutlet UIActivityIndicatorView *loadingIndicator;
    NSURL *contenturl;
}
-(void)setNavigationTitle:(NSString *)title;
-(void)setURL:(NSURL *)url;

@end


#import "HomePageWebViewController.h"


@implementation HomePageWebViewController
-(void)setURL:(NSURL *)url{
    contenturl = url;
}
-(void)setNavigationTitle:(NSString *)title{
    self.title = title;
}
- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

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

- (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.
}

#pragma mark WEBVIEW DELEGATE

- (void)webViewDidStartLoad:(UIWebView *)webView{
    [loadingIndicator startAnimating];
}
- (void)webViewDidFinishLoad:(UIWebView *)webView{
    [loadingIndicator stopAnimating];

}
- (void)webView:(UIWebView *)webView didFailLoadWithError:(NSError *)error{
    [loadingIndicator stopAnimating];

}
#pragma mark - View lifecycle

/*
 // Implement loadView to create a view hierarchy programmatically, without using a nib.
 - (void)loadView
 {
 }
 */

/*
 // Implement viewDidLoad to do additional setup after loading the view, typically from a nib.
 - (void)viewDidLoad
 {
 [super viewDidLoad];
 }
 */
-(void)viewWillAppear:(BOOL)animated{
    [super viewWillAppear:animated];
    [loadingIndicator startAnimating];
    [webView loadRequest:[NSURLRequest requestWithURL:contenturl]];
}

-(void)viewWillDisappear:(BOOL)animated{
    [super viewWillDisappear:animated];
    if([webView isLoading]){
        [webView stopLoading];
    }
}

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

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end


#import <UIKit/UIKit.h>
#import <MessageUI/MFMailComposeViewController.h>



@interface MainMenuViewController : UIViewController <UITableViewDelegate,UITableViewDataSource,UIPickerViewDelegate,UIPickerViewDataSource,MFMailComposeViewControllerDelegate> {

    NSMutableArray *aryProfessions;
    NSMutableArray *aryMainMenuItems;
//    NSMutableArray *barItems;

    IBOutlet UIPickerView *pkrProfession;
    IBOutlet UIToolbar *toolBar;
    IBOutlet UIBarButtonItem *btnDone;
    IBOutlet UIBarButtonItem *btnCancel;

    MFMailComposeViewController *controller;

    NSInteger _selIndex;
}

@property (nonatomic, assign) NSInteger selIndex;

- (IBAction)selectAnItem:(id)sender;
- (IBAction)itemNotSelected:(id)sender;


@end


#import "MainMenuViewController.h"
#import "HomePageWebViewController.h"
#import "DueDate.h"


@implementation MainMenuViewController
@synthesize selIndex = _selIndex;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
    self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
    if (self) {
        // Custom initialization
    }
    return self;
}

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

- (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.
}

#pragma mark - View lifecycle


- (void)viewWillAppear:(BOOL)animated
{
    self.title = @"ChiroCredit Main Menu";




    [pkrProfession setHidden:YES];
    [toolBar setHidden:YES];
    [btnDone setEnabled:NO];



    aryMainMenuItems = [[NSMutableArray alloc] initWithObjects:@"ChiroCredit Home Page",@"Countinuing Education Courses",@"Continuing Education FAQ's",@"Contact US",@"Remind me when Credits are Due",nil];

    aryProfessions = [[[NSMutableArray alloc] initWithObjects:@"Please Select Anyone Course",
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Aromatherapy",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=27",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Athletic Trainer",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=14",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Boundary Training",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=25",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Chiropractic Assistant",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=3",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Chiropractic Doctor",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=1",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Chiropractic Student",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=2",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Hand Therapist",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=4",@"url",nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Holistic Health Counselor",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=28",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Legal Secretary/Word Processor",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=34",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Massage Therapy",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=22",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Medical Doctor",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=32",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Naturopath",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=24",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Nursing",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=26",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Occupational Therapist",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=19",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"OT Assistant",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=21",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Other Florida Professionals",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=35",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"Physical Therapist",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=18",@"url", nil],
                       [NSDictionary dictionaryWithObjectsAndKeys:@"PT Assistant",@"title",@"http://www.chirocredit.com/courses/index.php?action=Show+Topics&pid=20",@"url", nil],
                       nil] retain];
    NSLog(@"array count is:- %i",[aryProfessions count]);
//    [pkrProfession reloadComponent:0];
    [self.view reloadInputViews];
    [super viewWillAppear:YES];
    // Do any additional setup after loading the view from its nib.
}


// Customize the number of sections in the table view.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
    return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return [aryMainMenuItems count];
}

// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

    cell.textLabel.font=[UIFont systemFontOfSize:16.0f];
    cell.textLabel.font=[UIFont boldSystemFontOfSize:16.0f];
    cell.accessoryType=UITableViewCellAccessoryDisclosureIndicator;
    cell.textLabel.text = [aryMainMenuItems objectAtIndex:indexPath.row];
    return cell;
}


- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
    if (indexPath.row == 0) {
        HomePageWebViewController *objHomePage = [[HomePageWebViewController alloc] initWithNibName:@"HomePageWebViewController" bundle:nil];
        [objHomePage setNavigationTitle:@"ChiroCredit"];
        [objHomePage setURL:[NSURL URLWithString:@"http://www.chirocredit.com/"]];
        [self.navigationController pushViewController:objHomePage animated:YES];
    }
    else if(indexPath.row == 1){
        [toolBar setHidden:NO];
//        barItems = [[NSMutableArray alloc] init];
//        
//        UILabel *lbl = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 72, 0)];
//        [lbl setTextAlignment:UITextAlignmentCenter];
//        NSString *strLabel = @"Please Select any one course";
//        lbl.text=strLabel;
//        lbl.textColor=[UIColor whiteColor];
//        
//        UIBarButtonItem *lblBtn = [[UIBarButtonItem alloc] initWithCustomView:lbl];
//        [lbl release];
//        
//        [barItems addObject:btnCancel];
//        [barItems addObject:lblBtn];
//        [barItems addObject:btnDone];
//        [toolBar setItems:barItems animated:YES];
//        [toolBar addSubview:lbl];
        [pkrProfession setHidden:NO];
    }
    else if(indexPath.row == 2){
        HomePageWebViewController *objHomePage = [[HomePageWebViewController alloc] initWithNibName:@"HomePageWebViewController" bundle:nil];
        [objHomePage setNavigationTitle:@"Continuing Education FAQ's"];
        [objHomePage setURL:[NSURL URLWithString:@"http://www.chirocredit.com/pages/faqs.php"]];
        [self.navigationController pushViewController:objHomePage animated:YES];
    }
    else if(indexPath.row == 3){
        NSArray *array1 = [[NSArray alloc]initWithObjects:@"[email protected]",nil];
        controller = [[MFMailComposeViewController alloc]init];
        controller.mailComposeDelegate = self;  
        [controller setSubject:@"Contact Online CE"];
        [controller setToRecipients:array1];
        NSString *emailBody = @" ";
        [controller setMessageBody:emailBody isHTML:NO];
        [self presentModalViewController:controller animated:YES];
        [controller release];
    }
    else{
        DueDate *objDueDate = [[DueDate alloc] initWithNibName:@"DueDate" bundle:nil];
        [self.navigationController pushViewController:objDueDate animated:YES];
    }    
}
- (void)mailComposeController:(MFMailComposeViewController*)controller  
          didFinishWithResult:(MFMailComposeResult)result 
                        error:(NSError*)error
{
    if (result == MFMailComposeResultSent) {
        NSLog(@"Mail Sent...!");

        UIAlertView *mailSend=[[UIAlertView alloc] initWithTitle:@"Email Sender" message:@"Mail has been sent.." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
        [mailSend show];
        [mailSend release];        
    }
    if (MFMailComposeResultCancelled) {
        [self.navigationController popViewControllerAnimated:YES];
    }
    [self dismissModalViewControllerAnimated:YES];
}

//PICKER VIEW DELEGATES....

- (NSInteger)numberOfComponentsInPickerView:(UIPickerView *)thePickerView {

    return 1;
}

- (NSInteger)pickerView:(UIPickerView *)thePickerView numberOfRowsInComponent:(NSInteger)component {


    return [aryProfessions count];

}



- (NSString *)pickerView:(UIPickerView *)thePickerView titleForRow:(NSInteger)row forComponent:(NSInteger)component {

    if (row==0){
        return [NSString stringWithFormat:@"Please Select Anyone Course"];
    }
    else{
        return [[aryProfessions objectAtIndex:row]valueForKey:@"title"];
    }
    return nil;


}



- (void)pickerView:(UIPickerView *)thePickerView didSelectRow:(NSInteger)row inComponent:(NSInteger)component {

    if (row == 0) {
        [btnDone setEnabled:NO];
    }
    else{
        [btnDone setEnabled:YES];
    }
     self.selIndex = row;
    if (self.selIndex == 0) {
        [btnDone setEnabled:NO];
    }
    else{
        [btnDone setEnabled:YES];
    }    
}

- (IBAction)selectAnItem:(id)sender {
    if (self.selIndex != 0) {
        NSDictionary *dicRow = [aryProfessions objectAtIndex:self.selIndex];
        HomePageWebViewController *objProfession = [[HomePageWebViewController alloc] initWithNibName:@"HomePageWebViewController" bundle:nil];
        [objProfession setNavigationTitle:[dicRow objectForKey:@"title"]];
        [objProfession setURL:[NSURL URLWithString:[dicRow objectForKey:@"url"]]];
        [self.navigationController pushViewController:objProfession animated:YES];
        [dicRow release];
    }

}

- (IBAction)itemNotSelected:(id)sender{
    [toolBar setHidden:YES];
    [pkrProfession setHidden:YES];
}


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

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
    // Return YES for supported orientations
    return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

@end
空城缀染半城烟沙 2024-11-13 12:30:20

您应该尝试 StockChartX iOS

You should try StockChartX iOS.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文