Interprozesskommunikation / Distributed Objects

mdtrinker

mdtrinker

Aktives Mitglied
Thread Starter
Dabei seit
02.02.2005
Beiträge
229
Reaktionspunkte
9
Hallo,
ich sitze schon seit Stunden an nem Problem mit Distributed Objects und habe keine Ahnung woran das liegen könnte. Habe zwei Prozesse. Der eine erstellt einen Baum aus Nodes und soll den dann per DO an den anderen Prozess übergeben. Die Node class enthält ein paar Parameter und ein NSMutableArray für die unter-Nodes.

Code:
Node *tree;
// ...Node-Baum erstellen...
processConnection = [NSConnection connectionWithRegisteredName:@"MyApp" host:nil];
MyObj *remoteObj = (MyObj*) [[processConnection rootProxy] retain];
[remoteObj setNodeTree:tree];

Das remoteObj erwartet bei setNodeTree die root-Node (copy). Die Kommunikation an sich funktioniert, ich wurde dann beim Übergeben der root-Node per Exception aufgefordert copyWithZone für die Node class zu implementieren:

Code:
-(id)copyWithZone:(NSZone*)zone
{
  Node *nodeCopy = [[[self class] allocWithZone:zone] init];
	
  [nodeCopy setSize:[self size]];
  [nodeCopy setSubnodes:[[self subnodes] copyWithZone:zone]];

  return nodeCopy;
}

Ich bekomme aber beim Client dann folgende Exception:

Code:
*** Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: '[NOTE: this exception originated in the server.]
Cannot create BOOL from object <Node: 0x10018f640> of class NSDistantObject'
*** Call stack at first throw:
(
	0   CoreFoundation                      0x00007fff81f687b4 __exceptionPreprocess + 180
	1   libobjc.A.dylib                     0x00007fff823a80f3 objc_exception_throw + 45
	2   Foundation                          0x00007fff8831e0c3 -[NSConnection sendInvocation:internal:] + 4304
	3   CoreFoundation                      0x00007fff81f3a98c ___forwarding___ + 860
	4   CoreFoundation                      0x00007fff81f36a68 _CF_forwarding_prep_0 + 232
	5   MyProgram                           0x00000001000015d5 main + 260
	6   MyProgram                           0x0000000100000fa8 start + 52
	7   ???                                 0x0000000000000002 0x0 + 2
)
terminate called after throwing an instance of 'NSException'

Hat jemand ne Ahnung was die Ursache sein könnte? Ich hab keine gute Dokumentation gefunden wie man bei ner DO Verbindung verschachtelte Objekte übergibt, die Beispiele enthalten immer nur simple Funktionsaufrufe und das geht auch. Der will anscheint irgendwo ein BOOL haben, nur die Node class enthält keine BOOL Variablen und bei den genutzten Funktionen kommt auch nirgendwo BOOL vor.
 
Zurück
Oben Unten