@implementation AppDelegate
- (void)applicationDidFinishLaunching
{
- ui = [[JubGtkUI alloc] init];
- id<XMPPRosterDelegate, XMPPConnectionDelegate> rosterDelegate =
- [ui rosterDelegate];
+ id<XMPPRosterDelegate, XMPPConnectionDelegate> rosterDelegate;
connection = [[XMPPConnection alloc] init];
[connection addDelegate: self];
connection.username = @"alice";
connection.password = @"test";
- [connection asyncConnectAndHandle];
+ ui = [[JubGtkUI alloc] initWithConnection: connection];
+ rosterDelegate = [ui rosterDelegate];
[connection addDelegate: rosterDelegate];
[roster addDelegate: rosterDelegate];
[roster addDelegate: self];
+ [connection asyncConnectAndHandle];
+
[ui startUIThread];
}