我有两个代表纬度和经度的字符串,如:" - 56.6462520",我想分配给一个CLLocation对象来比较我当前的位置.我尝试了下面的代码,但我只得到错误:
CLLocation * LocationAtual = [[CLLocation alloc]init];
LocationAtual.coordinate.latitude = @"-56.6462520";
LocationAtual.coordinate.longitude = @"-36.6462520";
Run Code Online (Sandbox Code Playgroud)
然后将对象与我的实际位置纬度和经度进行比较.有什么建议?
我怎样才能在里面声明一个整数数组RLMObject
?
喜欢 :
dynamic var key:[Int]?
Run Code Online (Sandbox Code Playgroud)
给出以下错误:
Terminating app due to uncaught exception 'RLMException', reason: ''NSArray' is not supported as an RLMObject property. All properties must be primitives, NSString, NSDate, NSData, RLMArray, or subclasses of RLMObject. See https://realm.io/docs/objc/latest/api/Classes/RLMObject.html for more information.'
Run Code Online (Sandbox Code Playgroud) 有什么方法可以使用XCTest在Swift中测试我的REPL项目吗?
我创建了一个新的目标,OSX Unit Testing Bundle,将目标依赖项配置到我的项目中,并尝试使用
@testable import test
Run Code Online (Sandbox Code Playgroud)
像这样声明这个类:
func testPath() {
let archiever = Archieves()
}
Run Code Online (Sandbox Code Playgroud)
我可以声明,但在构建和测试时,但我收到以下错误:
Undefined symbols for architecture x86_64:
"test.Archieves.__allocating_init (test.Archieves.Type)() -> test.Archieves", referenced from:
testTests.testTests.testPath (testTests.testTests)() -> () in testTests.o
"type metadata accessor for test.Archieves", referenced from:
testTests.testTests.testPath (testTests.testTests)() -> () in testTests.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Run Code Online (Sandbox Code Playgroud) ios ×2
swift ×2
arrays ×1
cllocation ×1
iphone ×1
objective-c ×1
realm ×1
string ×1
testing ×1