小编Vin*_*ino的帖子

字符串到CLLocation纬度和经度

我有两个代表纬度和经度的字符串,如:" - 56.6462520",我想分配给一个CLLocation对象来比较我当前的位置.我尝试了下面的代码,但我只得到错误:

CLLocation * LocationAtual = [[CLLocation alloc]init];
LocationAtual.coordinate.latitude = @"-56.6462520";
LocationAtual.coordinate.longitude = @"-36.6462520";
Run Code Online (Sandbox Code Playgroud)

然后将对象与我的实际位置纬度和经度进行比较.有什么建议?

string iphone objective-c cllocation

20
推荐指数
3
解决办法
5万
查看次数

在Realm Swift中声明一个Int数组

我怎样才能在里面声明一个整数数组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)

arrays realm ios swift

18
推荐指数
3
解决办法
1万
查看次数

我如何测试,使用XCTest和REPL swift

有什么方法可以使用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)

testing ios read-eval-print-loop swift

5
推荐指数
0
解决办法
194
查看次数