我正在开发一个iPhone应用程序,其中我想根据当前位置显示最近的餐馆为此在applicationDidFinishLaunching我这样做:
self.locationManager = [[CLLocationManager alloc] init];
locationManager.delegate = self;
locationManager.desiredAccuracy = kCLLocationAccuracyBest;
[locationManager startUpdatingLocation];
NSURL *url = [[NSURL alloc] initWithString:@"http://192.168.0.150/server1/Service.asmx/nearest?lat1=23.013163&lon1=72.559068"];
NSMutableURLRequest* request2=[NSMutableURLRequest requestWithURL:url];
[request2 setHTTPMethod:@"GET"];
[request2 setTimeoutInterval:10];
NSURLResponse *response=nil;
NSError *err=nil;
NSData *data1=[[NSURLConnection sendSynchronousRequest:request2 returningResponse:&response error:&err] retain];
if(data1 == nil)
{
UIAlertView* alert = [[UIAlertView alloc]initWithTitle:@"Alert" message:@"The network is not available.\n Please check the Internet connection." delegate:self cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
else
{
NSXMLParser *xmlParser = [[NSXMLParser alloc] initWithData:data1];
//Initialize the delegate.
XMLParser *parser = [[XMLParser alloc] …Run Code Online (Sandbox Code Playgroud) 我正在研究iPhone应用程序..
为了找到内存泄漏,我已经使用仪器启动了应用程序,这给了我很多泄漏.我无法理解然后在一个论坛的某个地方,我已经读过这些仪器会在某个时候发出虚假泄漏,所以我应该从静态分析开始.
然后我使用了Clang Static分析器,在解决了我的应用程序从静态分析的视图中没有错误之后它只给了我7个错误.
两种分析泄漏都不同.
如果我仍然使用仪器测试它仍然会泄漏.
所以我的问题是,我应该依靠clang Static Analyzer结果还是仪器结果..
我正在开发一个iPhone应用程序,其中我有一个页面,我在分段控件的控制中同时使用scrollview mkmapview和webview.
我这样做很有意思.
我的问题是我想在这些帧之外显示边框或框架.
我怎么能这样做?
我想在我的iPhone应用程序中创建一个包含上一个和下一个按钮的图库.
如果有人有想法,链接,示范或某些导致我实施画廊的东西,请提供给我.