English 中文(简体)
是否可能与我的注视中的5名排雷人员互动?
原标题:Is it possible to interact with iOS 5 s Reminders app from my app?
  • 时间:2011-10-04 21:00:24
  •  标签:
  • ios
  • ios5

是否有办法添加、阅读或删除新第5条“现场排雷人员”的提醒材料?

最佳回答
问题回答

The reminders are not on a public API. The "geofences" that are created are visible to some processes (I ve seen the fence count in console logs) but in no way accessible to another app. You are only able to register fences to your own app.

I do not believe this is possible. There is no public API that is available for developers.

I d really like access to the reminders too, I found a post explaninf adding events to the calendar here ..

在Peit日历上添加习俗活动

While the Calendar is "ok" for reminders, it makes more sence to use the IOS 5 "Reminders" app, after all SIRI can use it! :p

EDIT:我通过使用当地通知......解决了我的问题。

UILocalNotification *localNotif = [[UILocalNotification alloc] init];
if (localNotif == nil)
    return nil;
localNotif.fireDate = itemDate;
localNotif.timeZone = [NSTimeZone defaultTimeZone];

// Notification details
localNotif.alertBody = @"Here is your alert!";

// Set the action button title
localNotif.alertAction = @"View";

//localNotif.soundName = UILocalNotificationDefaultSoundName;
localNotif.soundName = @"Bell.aiff";
localNotif.applicationIconBadgeNumber = 1;

// Specify custom data for the notification
NSDictionary *infoDict = [NSDictionary dictionaryWithObject:myCustomMessage.text forKey:@"message"];
localNotif.userInfo = infoDict;

// Schedule the notification
[[UIApplication sharedApplication] scheduleLocalNotification:localNotif];

这使我能够提出似乎像普什通知这样的通知,并且即使在重新启用这些通知时,也保留这些通知。

如果需要的话,你可以清除。

[[UIApplication sharedApplication] cancelAllLocalNotifications];

原告

I can help you out with the trigger on arriving on predefined location. here is the code.

1: import CoreLocation.framework

2. 主计长。

#import <UIKit/UIKit.h>
#import <CoreLocation/CoreLocation.h>
@interface ViewController : UIViewController<CLLocationManagerDelegate>
@end

3. 概览

#import "ViewController.h"
@interface ViewController (){
CLLocationManager *locationManager;
CLRegion *mexicoBoundary;
}

@end

@implementation ViewController

- (void)viewDidLoad
{
   [super viewDidLoad];

locationManager = [[CLLocationManager alloc] init];
[locationManager setDelegate:self];
[locationManager setDistanceFilter:kCLDistanceFilterNone];



CLLocationCoordinate2D regionCords ;
//19.432608,-99.133208 lat, lon for mexico city
regionCords=CLLocationCoordinate2DMake(19.432608,-99.133208);
//5000 below, is in meters-radius 
mexicoBoundary =
[[CLRegion alloc]initCircularRegionWithCenter:regionCords
                                       radius:5000.0
                                   identifier:@"mexico_Day"];

[locationManager startMonitoringForRegion:mexicoBoundary];

}

-(void)locationManager:(CLLocationManager *)manager didEnterRegion:(CLRegion *)region
{
NSLog(@"%@: %@", @"region entered", region.identifier);

}

-(void)locationManager:(CLLocationManager *)manager didExitRegion:(CLRegion *)region
{
NSLog(@"%@: %@", @"region exited", region.identifier);
}



- (void)didReceiveMemoryWarning
{
  [super didReceiveMemoryWarning];
  // Dispose of any resources that can be recreated.
}

@end




相关问题
List Contents of Directory in a UITableView

I am trying to list the contents of Ringtones directory in a TableView, however, I am only getting the last file in the directory in ALL cells, instead of file per cell. This is my code: - (...

iPhone NSUserDefaults persistance difficulty

In my app i have a bunch of data i store in the NSUserdefaults. This information consists of an NSObject (Object1) with NSStrings and NSNumbers and also 2 instances of yet another object (Object2). ...

Writing a masked image to disk as a PNG file

Basically I m downloading images off of a webserver and then caching them to the disk, but before I do so I want to mask them. I m using the masking code everyone seems to point at which can be found ...

Resize UIImage with aspect ratio?

I m using this code to resize an image on the iPhone: CGRect screenRect = CGRectMake(0, 0, 320.0, 480.0); UIGraphicsBeginImageContext(screenRect.size); [value drawInRect:screenRect blendMode:...

Allowing interaction with a UIView under another UIView

Is there a simple way of allowing interaction with a button in a UIView that lies under another UIView - where there are no actual objects from the top UIView on top of the button? For instance, ...

热门标签