今天开发遇到一个奇怪的问题,如题。而且调试的时候参数没有问题。幸好程序简单,好调试,不然很难发现问题所在,因为程序会crash掉。最后找到了原因,主要是因为一时大意忘记给webview设置frame了,如下:
UIWebView *webView = [[UIWebView alloc]init];
NSURL* myurl = [[NSURL alloc]initWithString:self.url];
[webView loadRequest:[NSURLRequest requestWithURL:myurl]];
[self.view addSubview:webView];
[webView release];
然后就出现了CALayerInvalidGeometry', reason: 'CALayer position contains NaN:的问题,而且很难找出问题所在。以后编程还是要小心啊!