草庐IT

non-open

全部标签

ios - Swift 2.2 语法错误 : Cannot call value of non-function type 'UITableView!'

我在UITableView单元格中使用Tab手势,但出现以下错误。“无法调用非函数类型‘UITableView!’的值!”我正在使用从我以前的ObjectiveC项目继承的以下代码:varp:CGPoint=sender.locationInView(self.tableView)varindexPath:NSIndexPath=self.tableView(forRowAtPoint:p)varbuttonTag:Int=indexPath.rowvarselectView=self.storyboard?.instantiateViewControllerWithIdentifie

Swift 泛型 : Non-nominal type does not support explicit initialization

所以我试图理解通用协议(protocol)和类:protocolListPresenterTypewhereView.PDO.SW==Dispatcher.SW{associatedtypeDispatcher:ListDispatcherTypeassociatedtypeView:ListViewTypeinit(dispatcher:Dispatcher,state:@escaping(_state:AppState)->(ListState))funcattachView(_view:View)...}我从另一个通用类启动它:classAbstractListViewContr

swift - `open` 类的初始化程序是否也需要打开?

Swift3引入了新的open我在框架中使用的关键字。此框架中的open类是否需要在所述框架之外使用open初始化程序,或者init函数是否继承了open>上课声明?例如:openclassOpenClass{varA:Stringinit(){//doesthisinit()functionneedtobemarkedopen?A=String()}}附带问题:开放类OpenClass中的变量是否继承了其类的开放性质? 最佳答案 来自SE-0117Allowdistinguishingbetweenpublicaccessandp

ios - 错误 : UICollectionView must be initialized with a non-nil layout parameter

我正在尝试从youtube教程创建一个类似FacebookMessenger的应用程序。我有一个主页,用户可以在其中单击BarButton打开聊天。主页工作正常,直到我单击BarButton打开聊天,它崩溃并显示以下错误消息“必须使用非零布局参数初始化UICollectionView”。我是iOS开发的新手,所以无法真正理解问题出在哪里,因为我已经有了init方法。由于我有不同的观点,我是否在AppDelegate中遗漏了什么,这令人困惑:(。非常感谢您的帮助。谢谢!classChatViewController:UICollectionViewController,UICollect

Swift 协议(protocol)错误 : 'weak' cannot be applied to non-class type

Protocols和class-boundProtocols有什么区别,我们应该在Swift中使用哪一个?protocolA:class{...}protocolA{...}当协议(protocol)未定义为:class时尝试添加weak委托(delegate)时出现错误:protocolA{...}weakvardelegate:A给出错误:'weak'cannotbeappliedtonon-classtype或'weak'mustnotbeappliedtonon-class-bound'A';consideraddingaprotocolconformancethathasac

ios - 归档项目 : ld: can't open output file for writing 时出错

当我在设备上运行我的应用程序时,它运行良好,但是当我尝试将其存档以上传到iTunesConnect时,出现此错误:错误一:ld:can'topenoutputfileforwriting:/Users/xxxx/Library/Developer/Xcode/DerivedData/Drikkespillet-bmengfxihzksonhdoqpbllpzpagg/Build/Intermediates/ArchiveIntermediates/Drikkespillet/IntermediateBuildFilesPath/Drikkespillet.build/Release-i

ios - 使用 Firebase Storage 的 putFile() 方法导致 : The file “fileName” couldn’t be opened error

以下是我尝试上传文件的两种方式:1.getURLOfPhoto(assetURL:imagesDictionary[String(whichProfileImage)]!,completionHandler:{(responseURL)inFIRStorage.storage().reference().putFile(responseURLas!URL)})2.letassets=PHAsset.fetchAssets(withALAssetURLs:[imagesDictionary[String(whichProfileImage)]as!URL],options:nil)let

ios - 警告 : Unexpected version number in 'available' attribute for non-specific platform '*'

我有这段代码:@available(*,deprecated:3.0,message:"Useactivate().")publicfuncinstall(){self.activate()}自从我升级到swift5和xcode10.2之后,我收到以下警告:Unexpectedversionnumberin'available'attributefornon-specificplatform'*'并修复:Replace':3.0'with''这个警告是什么?它说什么? 最佳答案 documentation指出星号不能与Swift版本

ios - swift 错误 : '&' used with non-inout argument of type 'UnsafeMutablePointer'

我正在尝试从中转换以下Objective-C代码(source)-(CGRect)dimensionsForAttributedString:(NSAttributedString*)asp{CGFloatascent=0,descent=0,width=0;CTLineRefline=CTLineCreateWithAttributedString((CFAttributedStringRef)asp);width=CTLineGetTypographicBounds(line,&ascent,&descent,NULL);//...}进入swift:funcdimensionsFo

ios - ResponseSerializer 'cannot call value of non-function type ' NSHTTPURLResponse ?'' 与 Swift 3

在更新到Xcode8beta6之前,我一直在毫无问题地使用以下代码。它类似于thisexample来自Alamofire存储库。今天早上我将我的Alamofire库更新到最新的swift3分支,现在与beta6兼容。它显示错误:Cannotcallvalueofnon-functiontype'HTTPURLResponse?'存在类似问题here,但它不是基于当前版本的Swift和Alamofire。据我了解,这个错误是因为它认为我正在尝试返回Request属性(property)response而不是函数response(responseSerializer:,completion