我在我的應用程序中使用重要的位置更新。我已經通過將位置更新寫入文件進行了測試。它工作得很好。但是,如何將位置更新發送到服務器?聯繫服務器在iOS中的重要位置更新
現在我做這種方式,在didUpdate
功能,我調用一個函數:
Login* login = [[Login alloc] init]; // Login is subclass of nsobject
[login sendLocUpdate:latLong];
在sendLocUpdate
,我使用NSUrlConnection
的位置發送給服務器。這根本不是更新服務器,而是執行將位置詳細信息正確寫入文件的功能。請幫助我?謝謝!
你可以發送sendLocUpdate的代碼嗎? –
NSURLRequest * request = [NSURLRequest requestWithURL:[NSURL URLWithString:url]]; NSURLConnection *連接; connection = [[NSURLConnection alloc] initWithRequest:request delegate:self]; – Akshara