Re: How to check the number of pending events in the application event queue?

2008-10-27 Thread Peter Sagerson
Since you can postpone the task midstride, then you might just want to think of this in terms of breaking the task up into small pieces to be interspersed with event handling. - (void)doSomeMoreWork { [self doTheNextStep]; if([self isMoreWorkToDo]) [self performSelector:@sele

Re: performSelectorOnMainThread Help

2008-10-06 Thread Peter Sagerson
You appear to have declared updateAirDate: to be an instance method, but you're sending the message to the class. You want something more like [appDelegate performSelectorOnMainThread:@selector(updateAirDate:) withObject:airDate waitUntilDone:NO]; where appDelegate is the relevant instanc

Re: Core Data undo grouping

2008-10-03 Thread Peter Sagerson
[object setValue:@"1" forKey:@"attr"]; [self forceUndoBoundaryInContext:context]; [object setValue:@"2" forKey:@"attr"]; This is a little odd. If this is in the UI thread, it will be confusing to the user in the typical scenarios. Are you sure you don't want to create a nested undo group ?

Core Data undo grouping

2008-10-02 Thread Peter Sagerson
I'm using CoreData for some internal state management that sometimes requires an undo boundary in a specific place. In other words, I need something along these lines to work: NSManagedObject *object = [self getObjectFromSomewhere]; NSManagedObjectContext *context = [object managedObjectCont