Bridge-iOS Hangs if not in run loop.

18 views
Skip to first unread message

sbarow

unread,
Sep 7, 2012, 8:51:27 AM9/7/12
to bridge...@googlegroups.com
Hey,

Busy playing with Bridge for iOS. I have a simple app (AppDelegate, ViewController) I have the Bridge connect in my viewControllers viewDidLoad: method. However it does not seem to work properly I get the log 

If I run

- (void)viewDidLoad


{


    [super viewDidLoad];


        // Do any additional setup after loading the view.


   


    @autoreleasepool {


        // Bridge Server Settings


        NSDictionary* options = [NSDictionary dictionaryWithObjectsAndKeys:@"localhost", @"host", [NSNumber numberWithInt:8090], @"port", nil];


        // Allocate Bridge Object


        Bridge* bridge = [[Bridge alloc] initWithAPIKey:@"xxxxxxxxx" andDelegate:self options:options];


        [bridge connect];


    }


}




2012-09-07 14:45:12.170 Screecharama[7819:c07] Starting TCP connection localhost , 8090


But nothing more. However if I put 


[[NSRunLoop currentRunLoop] run];


dispatch_main();


Below in the Autorelease Pool I get this... 


2012-09-07 14:49:58.581 Screecharama[7881:c07] Starting TCP connection localhost , 8090

2012-09-07 14:49:58.583 Screecharama[7881:c07] Beginning handshake

2012-09-07 14:49:58.584 Screecharama[7881:c07] {

    command = CONNECT;

    data =     {

        "api_key" = xxxxxx;

        session =         (

            "<null>",

            "<null>"

        );

    };

}

2012-09-07 14:49:58.584 Screecharama[7881:c07] sending: {"command":"CONNECT","data":{"api_key":"bnhnmhnbchjdhhcn","session":[null,null]}}

2012-09-07 14:49:58.585 Screecharama[7881:c07] Connect length: 33

2012-09-07 14:49:58.586 Screecharama[7881:c07] client_id received: ldliikgglbggjfkn

2012-09-07 14:49:58.586 Screecharama[7881:c07] Handshake complete


o but then my app doesn't actually start (i.e no ViewController is shown) Is there something special I need to do to run it through my ViewController? 

Reply all
Reply to author
Forward
0 new messages