我有一个 CLLocation 管理器。它工作正常。
locManager = CLLocationManager()
locManager.delegate = self
locManager.desiredAccuracy = kCLLocationAccuracyBest
locManager.requestWhenInUseAuthorization()
locManager.startUpdatingLocation()
Run Code Online (Sandbox Code Playgroud)
当然,我有委托方法:
func locationManager(manager: CLLocationManager, didFailWithError error: NSError) {
println("didfail")
println(error)
}
func locationManager(manager:CLLocationManager, didUpdateLocations locations:[AnyObject]) {
println("location manager called..")
let locationLast = locations.last as! CLLocation
latitude = locationLast.coordinate.latitude.description
longitude = locationLast.coordinate.longitude.description
locManager.stopUpdatingLocation()
//....
}
Run Code Online (Sandbox Code Playgroud)
运行没有任何问题!但是,当我在这里 47.5775679 19.0488392(或在此点的 1-2 公里半径内)时,它会引发此错误:
Error Domain=kCLErrorDomain Code=0 “操作无法完成。(kCLErrorDomain 错误 0。)”
我也尝试过模拟器和真实设备。当我尝试时,我在真实设备上有互联网连接。有黑洞吗?:) 或者我不知道。
任何人都可以请给我任何想法,导致这种现象的原因是什么?
谢谢!
有没有办法GSMAddress
从placeID 获取.我有兴趣使用placeID
从autocompleteQuery
方法获得的地址.
PS:我有一个placeID
并且GMSAddress
在iOS中找到相应的方法.
谢谢,
我已经设置了一个PurchaseViewController
工作正常的程序,除了多个应用程序商店登录,我意识到这是SKPaymentQueue.defaultQueue().addTransactionObserver(self)
. 我需要将其插入到函数Appdelegate
的类中DidFinishLaunchingWithOptions
。当我这样做时:
import UIKit
import StoreKit
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate, SKPaymentTransactionObserver {
var window: UIWindow?
func application(application: UIApplication, didFinishLaunchingWithOptions launchOptions: [NSObject: AnyObject]?) -> Bool
{
UINavigationBar.appearance().barTintColor = UIColor(red: 0/255.0, green: 115/255.0, blue: 158/255.0, alpha: 1.0)
UINavigationBar.appearance().tintColor = UIColor.whiteColor()
UINavigationBar.appearance().titleTextAttributes = [NSForegroundColorAttributeName : UIColor.whiteColor()]
SKPaymentQueue.defaultQueue().addTransactionObserver(self)
// Override point for customization after application launch.
return true
}
Run Code Online (Sandbox Code Playgroud)
我明白了Type Appdelegate does not conform to protocol "SKPaymentTransactionObserver
。
有人可以指出我哪里出错了吗?
$ nvm ls:
.nvm
v0.11.12
v0.11.13
Run Code Online (Sandbox Code Playgroud)
我必须在每个会话中继续点击 nvm use v.0.11.13 :
.nvm
v0.11.12
Run Code Online (Sandbox Code Playgroud)
-> v0.11.13 我已经尝试过brew install 以及官方安装脚本。