草庐IT

METHOD_NAME

全部标签

ios - 更新到 Swift 2.0 'map' 不可用 : call the 'map()' method on the sequence

代码来自一个名为ZLBalancedFlowLayout的github控件。(link)。我一直在尝试更新到Swift2.0,但出现此错误“‘map’不可用:在序列上调用‘map()’方法”。任何意见将是有益的。提前谢谢你。privatefunccollectionView(collectionView:UICollectionView,framesForItemsInSectionsection:Int,inoutupdateContentSizecontentSize:CGSize)->([CGRect],[CGFloat]){letmaxWidth=Float(scrollDir

深入理解nginx server_name

一、基础概念nginx是一款轻量级的web服务器,同时也是一款高性能的反向代理服务器。server_name是nginx配置文件中比较重要的参数之一,用于指定虚拟主机的域名或IP地址。如果一个请求的Host头中的值和server_name匹配,则nginx将会使用该虚拟主机配置处理该请求。例如:server{listen80;server_namewww.example.com;location/{root/var/www/html;}}当该服务器收到Host头为www.example.com的请求时,nginx将会使用该配置进行处理。二、server_name的使用方法server_name

ios - 带有 Objective-C 选择器 'Method()' 的方法 'Method' 与具有相同 Objective-C 选择器的 'Method' 的 getter 冲突

自从更新到Xcode6.3后,我在我的一个扩展中遇到了这个问题......对于WKWebView..特别是在这些功能上。importUIKitimportWebKitextensionWKWebView:MyWebViewProvider{//Method'URL()'withObjective-Cselector'URL'conflictswithgetterfor'URL'withthesameObjective-CSelectorfuncURL()->NSURL?{returnself.URL}//Method'canGoBack()'withObjective-Cselecto

swift - 错误 : "no such module <Swift Cocoapod name>" with Jenkins

我正在尝试设置Jenkinsslave,以构建我的Swift项目,该项目使用名为“Freddy”的Swiftpod。问题是构建失败并出现错误:error:nosuchmodule'Freddy'这是我的Pod文件:platform:ios,'8.0'use_frameworks!target'MyProject'dopod'AFNetworking','~>3.0'pod'Freddy'endCocoaPods版本0.39.0Xcode7.2.1(直接从Xcode构建时没有问题)附言。在我将其替换为AFNetworking之前,Alamofirepod也出现了同样的问题。附言。Jenk

iOS 并发问题 : method returned before got the pedometer data

像下面的代码,当我想通过一个方便的方法返回一个计步器数据时,但是方法返回早于数据被检索。我认为这可能是一个并发问题。如何以正确的方式返回数据以供将来使用?ThxfuncqueryPedometerTodayTotalData()->Int{varpedometerDataOfToday:CMPedometerData?self.queryPedometerDataFromDate(NSDate.today()!,toDate:NSDate(),withHandler:{(pedometerData,error)inpedometerDataOfToday=pedometerData!p

swift - 在不再次运行的情况下更改 touch 内部的 node.name?

我想点击某个spritenode,改变那个spritenode的值。这就是问题所在。当我这样做并设置一个if语句时,它知道转到该if语句。但是,我不希望它在下次单击按钮之前运行。示例:apple.name="apple"overridefunctouchesBegan(_touches:Set,withevent:UIEvent?){fortouchintouches{letlocation=touch.location(in:self)letnode:SKNode=self.atPoint(location)ifnode.name=="apple"{appple.name="oran

docker: Error response from daemon: Conflict. The container name is already in use by container You

问题:docker启动docker容器时报错docker:Errorresponsefromdaemon:Conflict.ThecontainernameisalreadyinusebycontainerYouhavetoremove(orrename)thatcontainertobeabletoreusethatname.解决办法:在此之前已经启动了相同名字的docker容器,ThecontainernameisalreadyinusebycontainerYouhavetoremove(orrename)thatcontainertobeabletoreusethatname删除这个c

Swift 文档 : instance/type property/method notation

为了记录Ruby,我会写,例如,Time::now或Time#day。我如何记录Swift?也就是说,在编写Swift文档时,类型及其1)类型属性或方法或2)实例属性或方法的表示法是什么?例如,在Ruby文档中,符号::(两个冒号)表示类属性或方法,而符号#(数字符号、散列、井号标签),或井号)表示一个实例属性或方法。所以,Time::now表示now是Time的类属性或方法,而Time#day表示day是Time的实例属性或方法。Swift文档有这样的符号语法吗?我知道Swift文档的函数符号——例如,Swiftappend(_newElement:Element)methodfor

docker login harbor出现错误信息x509: certificate relies on legacy Common Name field, use SANs instead

x509:certificatereliesonlegacyCommonNamefield,useSANsinstead参考文档配置证书:Harbordocs|ConfigureHTTPSAccesstoHarbor(goharbor.io)

objective-c - 如何从协议(protocol)方法描述列表中解密 "objc_method_description"?

我有一些Swift3代码来解码iOSObjective-C协议(protocol)(它有一个Swift对应协议(protocol))。在断定Swift3反射还不足以完成我需要的功能后,我偶然发现了objc运行时方法protocol_copyMethodDescriptionList(),它返回以下C结构的数组:structobjc_method_descriptionSELname;char*types;};代码获取协议(protocol)选择器名称列表,但不确定type字段中返回的是什么。我对如何正确解码objc_method_description.type值感到困惑。我在type