|
Go
![]() |
New
![]() |
Find
![]() |
Notify
![]() |
Tools
![]() |
Reply
![]() |
|
|
Journeyman |
Alright, I'm getting into the plug-in angle now. I've got a basic question (well, a few really) but this is a start.
Say I want to change the name of an appointment (I do). I am able to retrieve the existing name, but trying to set a new name is giving me a [<GWTimeblock 0x6946bc0> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key activityName. relevant code: NSArray *timeblock_objects = [sender valueForKey:@"Objects"]; // only timeblock objects should be available to us NSEnumerator *e = [timeblock_objects objectEnumerator]; id obj = nil; while (obj = [e nextObject]) { MCPObjectContext *oc = [obj objectContext]; // not necessary to get, but to set? Is context implicit in plugins? NSString *currentApptTitle = [obj valueForKey:@"activityName"]; // gets current timeblock act name fine NSString *myNewName = @"Hi Everybody! (Hi, Dr Nick!)"; [obj setValue:myNewName forKey:@"activityName"]; // nope, undefined key error.. hmm [oc saveChanges]; } So I imagine there is an easy answer... Or activityName really isn't compliant? Thanks! -E |
||
|
|
Marketcircle Team |
That's a good one.
What we've done here, is implement what is called an 'informal read-only protocol'. It is used in read-only places. For example, that protocol was done for the activity tab and the reminder window. Those guys show data and do not edit the data directly - hence we didn't add the 'set' equivalents. I guess we should mark those in the API somehow and truth be told - I didn't even think about that until I saw your post. It never crossed my mind. So the answer is indeed easy. Use: setValue:@"my whatever" forKey:@"subject" |
|||
|
|
Journeyman |
Ok, good to know. Thank you AJ.
|
|||
|
| Previous Topic | Next Topic | powered by eve community |
| Please Wait. Your request is being processed... |
|

