Attributed Strings in Distributed Objects
Attributed Strings in Distributed Objects
- Subject: Attributed Strings in Distributed Objects
- From: "Gerriet M. Denkmann" <email@hidden>
- Date: Wed, 5 Sep 2007 09:23:42 +0200
I have an object, which responds to this message:
- (NSAttributedString *)dummyWithStyle: (BOOL)withStyle ;
{
NSString *s = withStyle ? @"with Style" : @"without Style";
NSMutableAttributedString *a = [ [ [ NSMutableAttributedString
alloc ] initWithString: s ] autorelease ];
if ( withStyle )
{
NSParagraphStyle *p = [ NSParagraphStyle defaultParagraphStyle ];
unsigned int length = [ a length];
NSRange all = NSMakeRange( 0, length );
[ a addAttribute: NSParagraphStyleAttributeName value: p range:
all ];
};
NSLog(@"%s will return %@", __FUNCTION__, a );
return a;
}
If the flag "withStyle" is NO, or if sender and reveiver live in the
same thread (i.e. [myObject isProxy ] = 0) then all is fine.
But when I do: [proxyForMyObject dummyWithStyle: YES ] (with
[proxyForMyObject isProxy] = 1) then the program will hang after
writing the log message immediately before the return.
(gdb) bt
#0 0x9000b348 in mach_msg_trap ()
#1 0x9000b29c in mach_msg ()
#2 0x907ddba8 in __CFRunLoopRun ()
#3 0x907dd4ac in CFRunLoopRunSpecific ()
#4 0x92bd45a4 in -[NSConnection sendInvocation:] ()
#5 0x92c89ee4 in -[NSDistantObject hash] ()
#6 0x937e789c in attributeDictionaryHash ()
#7 0x907dbcd8 in __CFSetFindBuckets1b ()
#8 0x907db3f8 in CFSetGetValue ()
#9 0x937e754c in +[NSAttributeDictionary newWithDictionary:] ()
#10 0x92bfb630 in -[NSConcreteMutableAttributedString
setAttributes:range:] ()
#11 0x92c40ac4 in _NSReadMutableAttributedStringWithCoder ()
#12 0x92c4086c in -[NSAttributedString initWithCoder:] ()
#13 0x92bd8b58 in -[NSConcretePortCoder decodeRetainedObject] ()
#14 0x92bd5330 in _NSWalkData ()
#15 0x92bdce9c in -[NSInvocation decodeReturnValueWithCoder:] ()
#16 0x92bd4854 in -[NSConnection sendInvocation:] ()
#17 0x92bd3040 in -[NSObject(NSForwardInvocation) forward::] ()
#18 0x90a450b0 in _objc_msgForward ()
#19 0x00039c08 in -[SWDocument doButton:] <-- the button which
starts it all
What am I doing wrong?
Kind regards,
Gerriet.
_______________________________________________
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