我的代码:
let calendar = NSCalendar.currentCalendar()
let dateComponents = calendar.components(NSCalendarUnit.YearCalendarUnit | NSCalendarUnit.MonthCalendarUnit | NSCalendarUnit.DayCalendarUnit, fromDate: self)
Run Code Online (Sandbox Code Playgroud)
我的错误:
'YearCalendarUnit' was deprecated in OS X version 10.10: Use NSCalendarUnitYear instead
'MonthCalendarUnit' was deprecated in OS X version 10.10: Use NSCalendarUnitMonth instead
'DayCalendarUnit' was deprecated in OS X version 10.10: Use NSCalendarUnitDay instead
Run Code Online (Sandbox Code Playgroud)
但我不能键入NSCalendarUnitYear以及(NSCalendarUnitMonth/NSCalendarUnitDay)有什么问题?
我有CATextLayer清洁问题.和iOS一起解决方案是:
textLayer.contentsScale = UIScreen.mainScreen.scale
Run Code Online (Sandbox Code Playgroud)
但我无法在可可NSScreen上找到"规模"属性
注意:使用Object-C或Swift的答案都可以.
我的代码:
NSFileManager.defaultManager().removeItemAtPath(path, error: nil)
Run Code Online (Sandbox Code Playgroud)
我的日志错误:
NSUnderlyingError=0x618000255900 "The operation couldn’t be completed. Permission denied"})
“SecureDelete Lite” couldn’t be removed because you don’t have permission to access it
Run Code Online (Sandbox Code Playgroud)
我已经阅读了两个主题,但他们没有解决我的错误.
使用Objective-C或Swift的答案都可以.
如何在应用程序沙盒时使用"登录时启动"功能创建应用程序?
Linux的命令
echo 3 > /proc/sys/vm/drop_caches
Run Code Online (Sandbox Code Playgroud)
我在URL中读到了这个命令:
https://unix.stackexchange.com/questions/58553/how-to-clear-memory-cache-in-linux
什么命令在Mac上类似?
macos ×5
ios ×3
cocoa ×2
swift ×2
catextlayer ×1
cocoa-touch ×1
command ×1
file ×1
linux ×1
objective-c ×1
terminal ×1
unix ×1
xcode ×1