在通过Xcode进行调试时手动运行应用程序vs手动运行应用程序
问题描述:
我有一个Cocoa应用程序。它通过XCode 6
运行正常,但是当我通过Finder
手动运行时,它表现得非常奇怪:似乎只有静态XIB
加载,没有其他代码得到executed
。在通过Xcode进行调试时手动运行应用程序vs手动运行应用程序
我需要签署才能工作吗?我也试过归档。对于任何线索,这是第一次执行代码:
NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL:[NSURL URLWithString:url]];
[request setHTTPMethod:verb];
NSData *data = [qs dataUsingEncoding:NSUTF8StringEncoding];
[request setHTTPBody:data];
NSError *err;
NSURLResponse *response;
NSData *responseData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&err];
NSString *resSrt = [NSString stringWithFormat:@"%@", responseData];
是的,有HTTP的设计改变applicationDidFinishLaunching
首先提出了要求。
谢谢!
编辑:忘了提及,我使用dispatch_queue_t
和dispatch_async
这些请求,所以我不阻止主线程。
它阻止应用程序委托方法,这是一个好主意? – trojanfoe
忘了提及我为这些请求使用'dispatch_queue_t'和'dispatch_async',所以我没有阻塞主线程。 – MariusP
控制台日志中是否有应用程序消息? /Applications/Utilities/Console.app是你的朋友。 –