草庐IT

expose_used

全部标签

ios - 'YearCalendarUnit' 在 OS X 版本 10.10 : Use NSCalendarUnitYear instead 中被弃用

我的代码:letcalendar=NSCalendar.currentCalendar()letdateComponents=calendar.components(NSCalendarUnit.YearCalendarUnit|NSCalendarUnit.MonthCalendarUnit|NSCalendarUnit.DayCalendarUnit,fromDate:self)我的错误:'YearCalendarUnit'wasdeprecatedinOSXversion10.10:UseNSCalendarUnitYearinstead'MonthCalendarUnit'wa

ios - 'YearCalendarUnit' 在 OS X 版本 10.10 : Use NSCalendarUnitYear instead 中被弃用

我的代码:letcalendar=NSCalendar.currentCalendar()letdateComponents=calendar.components(NSCalendarUnit.YearCalendarUnit|NSCalendarUnit.MonthCalendarUnit|NSCalendarUnit.DayCalendarUnit,fromDate:self)我的错误:'YearCalendarUnit'wasdeprecatedinOSXversion10.10:UseNSCalendarUnitYearinstead'MonthCalendarUnit'wa

ios - '初始化()' is deprecated: init() will be removed in Swift 3. Use ` 零`

我正在使用这段代码。varaudioUnit:AudioUnit=AudioUnit()但是在Xcode7.3(Swift2.2)中我收到了这个警告。知道为什么吗?我怎样才能摆脱它?注意如果我使用nil那么我的程序就会崩溃。 最佳答案 AudioUnit是AudioComponentInstance的类型别名,它本身是COpaquePointer的类型别名。InitializingpointerswillberemovedwithSwift3.0,只需将变量设置为nil。nil和AudioUnit()应该做同样的事情。如果您的程序因

ios - '初始化()' is deprecated: init() will be removed in Swift 3. Use ` 零`

我正在使用这段代码。varaudioUnit:AudioUnit=AudioUnit()但是在Xcode7.3(Swift2.2)中我收到了这个警告。知道为什么吗?我怎样才能摆脱它?注意如果我使用nil那么我的程序就会崩溃。 最佳答案 AudioUnit是AudioComponentInstance的类型别名,它本身是COpaquePointer的类型别名。InitializingpointerswillberemovedwithSwift3.0,只需将变量设置为nil。nil和AudioUnit()应该做同样的事情。如果您的程序因

swift 2.0 : use of self in method call before stored properties are initialised

这周末才开始研究Swift。我正在为我的类(class)创建一个id以快速比较对象。我想要一个不可变的id,所以应该使用let。使用var并将id初始化为""将修复"在初始化存储属性之前在方法调用中使用self"但当然它是可变的。我见过的与此类似的所有其他问题都是关于父类(superclass)/调用super.init,我没有。很郁闷,不知道为什么不直截了当。classMagicCard{letid:Stringletname:StringletmanaCost:Intletdescription:Stringletattack:Intletdefence:Intinit(name:

swift 2.0 : use of self in method call before stored properties are initialised

这周末才开始研究Swift。我正在为我的类(class)创建一个id以快速比较对象。我想要一个不可变的id,所以应该使用let。使用var并将id初始化为""将修复"在初始化存储属性之前在方法调用中使用self"但当然它是可变的。我见过的与此类似的所有其他问题都是关于父类(superclass)/调用super.init,我没有。很郁闷,不知道为什么不直截了当。classMagicCard{letid:Stringletname:StringletmanaCost:Intletdescription:Stringletattack:Intletdefence:Intinit(name:

swift - 错误 : Use of unresolved Identifier 'Process'

操作系统:Ubuntu16.04Swift版本:3.0预览版6我正在关注这个gettingstartedpage在greeter.swift中funcsayHello(name:String){print("Hello,\(name)!")}在main.swift中ifProcess.arguments.count!=2{print("Usage:helloNAME")}else{letname=Process.arguments[1]SayHello(name:name)}我收到的错误$swiftbuildCompileSwiftModule'myapp'(2sources)/Sou

swift - 错误 : Use of unresolved Identifier 'Process'

操作系统:Ubuntu16.04Swift版本:3.0预览版6我正在关注这个gettingstartedpage在greeter.swift中funcsayHello(name:String){print("Hello,\(name)!")}在main.swift中ifProcess.arguments.count!=2{print("Usage:helloNAME")}else{letname=Process.arguments[1]SayHello(name:name)}我收到的错误$swiftbuildCompileSwiftModule'myapp'(2sources)/Sou

ios - 谷歌地图 iOS SDK : custom icons to be used as markers

AndroidAPI有一个非常方便的类,IconGenerator.使用IconGenerator在我的Android应用中,我可以轻松地制作一个标记:是一个带有我选择的颜色的简单矩形。调整大小以容纳任何长度的文本。不是信息窗口-我希望标记本身包含文本,如下图所示,来自android版本。//Android-problemsolvedwithIconGeneratorIconGeneratoriconGenerator=newIconGenerator(context);iconGenerator.setStyle(IconGenerator.STYLE_GREEN);//oranyo