Tag: web services

exception:无法识别的select器,当我点击calloutAccessoryControlTapped

实际上,当我点击引脚的calloutAccessoryControlTappedbutton时,我得到了这个exception,我试着跟踪在控制台中的NSLog的错误,我发现唯一的引脚导致这个exception有价值<null> ,我通过一些代码解释: for (int i=0; i<[array count]; i++) { NSDictionary *stationEnCours=[array objectAtIndex:i]; location2D = (CLLocationCoordinate2D){ .latitude = lat, .longitude = lng }; MyLocation *annotation=[[[MyLocation alloc]initWithName:ensStation distanceVersLaStation:distance coordinate:location2D]autorelease]; //here we set the properties before we get call to addAnnotation annotation.stationAdress=[stationEnCours objectForKey:@"ssiphone_adresse"]; NSLog(@"%@",annotation.stationAdress); [mapView addAnnotation:annotation]; } 我有4个站,在控制台我得到这个: 2011-05-11 22:27:11.768 TopStation[2370:207] A 51 – Aire de la Champouse […]

使用参数调用JSON Web服务 – Objective C – iOS

我试图调用一个简单的JSON webservice与目标c中的参数。 到目前为止不工作。 这是Web服务方法: [WebMethod] [ScriptMethod(ResponseFormat = ResponseFormat.Json)] public void LogIn(string username, string password) { Context.Response.Write(username + "___" + password); Context.Response.End(); } 这是我的目标C代码: // Build dictionnary with parameters NSString *username = @"usernameTest"; NSString *password = @"passwordTest"; NSMutableDictionary *dictionnary = [NSMutableDictionary dictionary]; [dictionnary setObject:username forKey:@"username"]; [dictionnary setObject:password forKey:@"password"]; NSError *error = nil; NSData *jsonData = [NSJSONSerialization […]

获取iOS 5中最后一个redirect的url?

有人可以请求最简单的工作代码,可以得到最后一个redirect的url(nth)当我GET请求一个url? 我知道我需要使用asynchronous请求,但我无法制定出解决问题的完整工作代码。 我使用的是ios5,所以我可以使用ios5中最新添加的asynchronous内置function。 我尝试了很多东西,但是我还是不成功。 使用下面的代码,我试图发送一个获取请求的参数,但不知何故这些参数由于网站的redirect而丢失:(! NSURLRequest *request = [NSURLRequest requestWithURL:urlOriginal]; [NSURLConnection sendAsynchronousRequest:request queue:[NSOperationQueue mainQueue] completionHandler:^(NSURLResponse *response, NSData *data, NSError *error) { NSLog("the returned data should be the final data of the redirected url with parameters but it is not"); }]; } 编辑 所以这就是我现在所做的: NSURLRequest *requestOriginal = [NSURLRequest requestWithURL:urlOriginal]; NSURLConnection *connection = [[NSURLConnection alloc] initWithRequest:requestOriginal delegate:self]; […]

Objective-C与Microsoft Dynamics CRM交互

我期待从我的iPhone与我的Microsoft Dynamics CRM系统进行交互,执行诸如下拉,更新,创build和删除logging等任务。 这可能吗? 如果是这样的话,任何人都可以联系到我的任何资源,或提供任何您认为相关的信息? 非常感谢, 插口

IOS 9 NSURLConnection已弃用

我升级到IOS9 xcode,而我不工作的方法获得我的web服务的答案,这部分NSData * urlData = [NSURLConnection sendSynchronousRequest:request returningResponse:&response error:&error]; 已弃用。 https://developer.apple.com/library/ios/documentation/Cocoa/Reference/Foundation/Classes/NSURLConnection_Class/index.html#//apple_ref/doc/uid/TP40003755 NSString *post =[[NSString alloc] initWithFormat:@"lang=%@&type=ssss",@"en"]; NSURL *url=[NSURL URLWithString:@"http://www.xxxxxxxxxx.com/xxxxxxx/ws/get_xxxxx.php"]; NSData *postData = [post dataUsingEncoding:NSASCIIStringEncoding allowLossyConversion:YES]; NSLog(@"esta es la url: %@", postData); NSString *postLength = [NSString stringWithFormat:@"%lu", (unsigned long)[postData length]]; NSMutableURLRequest *request = [[NSMutableURLRequest alloc] init]; [request setURL:url]; [request setHTTPMethod:@"POST"]; [request setValue:postLength forHTTPHeaderField:@"Content-Length"]; [request setValue:@"application/json" forHTTPHeaderField:@"Accept"]; […]

适用于iOS的Google Places API与Google放置Web服务

我打算有一个应用程序列出与UISearchController相结合的自动完成functionUITableView附近的地方,以过滤的地方的结果,我试图使用Google Places API。 我很困惑,因为我不知道应该使用哪个API: Google Places API Web服务 要么 Google Places API for iOS 我没有find获取Google Places API for iOS文档中的地点列表的方法。 何时使用Google Places API Web服务以及何时使用适用于iOS的Google Places API ? 和什么在我的情况下效果最好(获取分页和按名称和类别选项筛选的地方列表) 我已经为Google Places API for iOS生成了一个API-KEY,我仍然可以在Google Places API Web Service中使用这个键吗?

如何上传一个mp3文件高达5 MB的大小在web服务器上的iPhone

我想从我的iPhone应用程序上传一个audio文件到networking服务器,但是当我把它转换成NSData的时候,它将花费30到40分钟的转换,所以你可以给它更好的解决scheme。

NSJSONSerialization – 无法将数据转换为string

我遇到了从Met Office Datapoint API读取JSON的NSJSONSerialization问题。 我得到以下错误 Error Domain=NSCocoaErrorDomain Code=3840 "The operation couldn't be completed. (Cocoa error 3840.)" (Unable to convert data to string around character 58208. 我已经检查并认为这是根据字符位置的违规行 {"id":"353556","latitude":"57.1893","longitude":"-5.0929","name":"Sóil Chaorainn"} 根据我尝试过的几个validation器,JSON本身似乎是有效的,我也希望它也来自Met Office这样的大型组织。 NSJSONSerialization不应该与'ó'这样的字符一起工作吗? 如果不是我怎么去改变编码types来处理这个? 提前谢谢了

iOS应用程序在后台执行任务

我想知道如果我可以发送一些web服务调用,而我的应用程序在后台。 Skype如何做到这一点? 即使我按主页button我的电话保持连接。