{"action":"created","issue":{"url":"https://api.github.com/repos/swisspol/GCDWebServer/issues/131","labels_url":"https://api.github.com/repos/swisspol/GCDWebServer/issues/131/labels{/name}","comments_url":"https://api.github.com/repos/swisspol/GCDWebServer/issues/131/comments","events_url":"https://api.github.com/repos/swisspol/GCDWebServer/issues/131/events","html_url":"https://github.com/swisspol/GCDWebServer/issues/131","id":56362856,"number":131,"title":"Crash when open the http URL on the main thread ","user":{"login":"cloud-hot","id":6189279,"avatar_url":"https://avatars.githubusercontent.com/u/6189279?v=3","gravatar_id":"","url":"https://api.github.com/users/cloud-hot","html_url":"https://github.com/cloud-hot","followers_url":"https://api.github.com/users/cloud-hot/followers","following_url":"https://api.github.com/users/cloud-hot/following{/other_user}","gists_url":"https://api.github.com/users/cloud-hot/gists{/gist_id}","starred_url":"https://api.github.com/users/cloud-hot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cloud-hot/subscriptions","organizations_url":"https://api.github.com/users/cloud-hot/orgs","repos_url":"https://api.github.com/users/cloud-hot/repos","events_url":"https://api.github.com/users/cloud-hot/events{/privacy}","received_events_url":"https://api.github.com/users/cloud-hot/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/swisspol/GCDWebServer/labels/question","name":"question","color":"fbca04"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-02-03T11:00:04Z","updated_at":"2015-02-03T17:26:47Z","closed_at":"2015-02-03T17:26:47Z","body":"It seems that GCDWebServer can only run on the main thread, and if i run UIApplication.sharedApplication().openURL it will crash. Is there any solution for this issue? Thanks!"},"comment":{"url":"https://api.github.com/repos/swisspol/GCDWebServer/issues/comments/72694342","html_url":"https://github.com/swisspol/GCDWebServer/issues/131#issuecomment-72694342","issue_url":"https://api.github.com/repos/swisspol/GCDWebServer/issues/131","id":72694342,"user":{"login":"swisspol","id":627915,"avatar_url":"https://avatars.githubusercontent.com/u/627915?v=3","gravatar_id":"","url":"https://api.github.com/users/swisspol","html_url":"https://github.com/swisspol","followers_url":"https://api.github.com/users/swisspol/followers","following_url":"https://api.github.com/users/swisspol/following{/other_user}","gists_url":"https://api.github.com/users/swisspol/gists{/gist_id}","starred_url":"https://api.github.com/users/swisspol/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swisspol/subscriptions","organizations_url":"https://api.github.com/users/swisspol/orgs","repos_url":"https://api.github.com/users/swisspol/repos","events_url":"https://api.github.com/users/swisspol/events{/privacy}","received_events_url":"https://api.github.com/users/swisspol/received_events","type":"User","site_admin":false},"created_at":"2015-02-03T17:26:47Z","updated_at":"2015-02-03T17:26:47Z","body":"I see. You need to retain the `GCDWebServer` instance after creating it or it won't live past the application-did-finish-launching function. Typically one would use an instance variable on the application delegate class.\r\n\r\nAlso opening the URL on the same device is unlikely to work correctly since the app is going to go in the background and be \"frozen\" by iOS: see the README."}}