needing help w/ asynchronous message problem, using YAMessageQueue
needing help w/ asynchronous message problem, using YAMessageQueue
- Subject: needing help w/ asynchronous message problem, using YAMessageQueue
- From: Shane <email@hidden>
- Date: Fri, 15 Jan 2010 22:04:08 -0600
I have a thread already where I use asynchronous messages to
communicate (using YAMessageQueue). My main application thread sends
messages to a task thread similar to the below line, but for some
reason, when I'm sending from my task thread to the main application
thread, I'm getting the following error (I do have other messages from
my task thread to the main app thread that do work, just not this
one).
2010-01-15 21:28:50.483 myApp[16330:420b] YAMessageQueue caught "***
-[NSCFArray insertObject:atIndex:]: attempt to insert nil" when
invoking updateLoadedNetworkConfiguration:
[[clientQueue proxyForTarget:controller] updateLoadedNetworkConfiguration:nc];
I think it may have something to do w/ the class that I'm trying to
pass to it (nc) which is my NetworkConfiguration class.
@interface NetworkConfiguration : NSObject <NSCoding>
{
NSNumber *a;
NSNumber *b;
NSNumber *c;
NSNumber *d;
NSNumber *e;
NSNumber *f;
NSNumber *g;
NSNumber *h;
NSString *i;
NSString *j;
NSString *k;
NSString *l;
NSMutableDictionary *m;
}
+ (NetworkConfiguration *) sharedInstance;
+ (id) allocWithZone:(NSZone *) zone;
- (id) copyWithZone:(NSZone *) zone;
- (id) retain;
// …
@end
There's a callback in the YAMessageQueue class where I see where the
error is coming from, but don't quite understand what's going on or
still, why this is happening.
static void
rlsCallBack(void *info)
{
YAMessageQueue *queue = [(YAMessageQueue*)info retain];
NSInvocation *invoc;
do {
invoc = nil;
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NS_DURING
invoc = [queue dequeueInvocation];
if (invoc)
[invoc invoke];
NS_HANDLER
NSLog(@"YAMessageQueue caught \"%@\" when invoking %s",
localException, invoc ? (const char*)[invoc selector] :
"dequeueInvocation");
NS_ENDHANDLER
[pool release];
} while (invoc!=nil);
[queue release];
}
Any help in understanding this, much appreciated.
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden