Jas*_*son 0 objective-c userinfo uilocalnotification
我正在尝试将NSManagedObjectID附加到UILocalNotification但仍然收到错误:属性列表对格式无效:200(属性列表不能包含'CFType'类型的对象)
这是我的代码(taskID是一个NSManagedObjectID):
// Create the new notification
UILocalNotification *newNotice = [[notificationClass alloc] init];
[newNotice setFireDate:date];
[newNotice setTimeZone:[NSTimeZone defaultTimeZone]];
[newNotice setAlertBody:@"Test text"];
// Add the object ID to the userinfo
NSDictionary *myUserInfo = [NSDictionary dictionaryWithObject:taskID forKey:@"TaskID"];
newNotice.userInfo = myUserInfo;
Run Code Online (Sandbox Code Playgroud)
taskID通过此代码传递给函数(第一个参数):
addNotification([task objectID], [task taskname], [task taskexpiry]);
Run Code Online (Sandbox Code Playgroud)
task是一个NSManagedObject,并且该代码已经过测试并且工作正常了很长时间.
从我读过的一切来看,这应该有效.任何帮助将不胜感激.
贾森
| 归档时间: |
|
| 查看次数: |
6439 次 |
| 最近记录: |