草庐IT

Ambiguous

全部标签

ios - 当所有 UI 元素都设置为 setTranslatesAutoresizingMaskIntoConstraints = NO 时,为什么我会看到 NSAutoresizingMaskLayoutConstraint

我正在尝试调试UI布局,我在代码中添加的所有元素都标有[self.elementsetTranslatesAutoresizingMaskIntoConstraints:NO];XIB文件中唯一设置的是View的背景颜色(选项卡式viewController中的许多View之一。当我查看NSLog时,我看到以下内容:*-AMBIGUOUSLAYOUT|*||*|||*||||*|||||*||||||*|||||||*||||||||*-AMBIGUOUSLAYOUT||||||||*-AMBIGUOUSLAYOUT||||||||*-AMBIGUOUSLAYOUT|||||||||*

ios - swift 3.0 : Ambiguous reference to member 'Subscript' issue in push notification

这是下面的代码,但我在swift3中收到以下错误funcapplication(_application:UIApplication,didReceiveRemoteNotificationuserInfo:[AnyHashable:Any],fetchCompletionHandlercompletionHandler:@escaping(UIBackgroundFetchResult)->Void){notificationReceived(notification:userInfoas[NSObject:AnyObject])}funcnotificationReceived(n

ios - Xcode 7.3 : "Ambiguous expansion of macro" when re-defining macro in prefix file

我正在使用Xcode7.3,并且收到“宏扩展不明确”的警告,这是针对在Foundation中定义的宏,但我在前缀文件中未定义和重新定义的宏。我启用了模块。重现:在build设置中将“启用模块(C和Objective-C)”设置为"is"使用以下前缀文件:#import#undefassert#defineassert(e)NSLog(@"hi")//implementationisnotimportant使用下面的主要源文件:intmain(){assert(42);return0;}然后在Xcode中构建。它在源文件中使用“断言”宏的行上显示“宏‘断言’的扩展不明确”警告。“Expa

ios - "Ambiguous use of subscript"新 Swift 更新后出错

我的项目之前运行良好,如果使用模拟器仍然运行良好。但是,当我连接iPhone并尝试运行该项目时,出现此错误:“下标使用不明确”在此行检索JSON信息时:letchannels=jsonResult["channels"]?[0]as?[String:AnyObject]感谢任何解决此问题的帮助! 最佳答案 编译器似乎更受类型限制。jsonResult["channels"]的结果类型是AnyObject您必须通过检查数组的值来帮助编译器。ifletchannels=jsonResult["channels"]as?[AnyObjec

swift - 在设备上模糊使用 'subscript'

我的应用程序已在我的模拟器上完成,但当我尝试在我的手机上使用时,我遇到了2个错误“下标”的使用不明确我正在阅读这篇文章,但无法修复它。HowtosolveAmbiguoususeof'subscript'inSwift2?问题就在这里letfavs=rescataRegistrosFav()print(favs)print("-----------------------------------------------")if(arrayCompleta[row][2]==""){cell.imagenMovil.image=nil}else{cell.imagenMovil.imag

ios - 表达式类型 'DataRequest' 在没有更多上下文 Swift 的情况下是不明确的

我在这个函数中使用Alamofire来处理我的请求,如果有人可以帮助我,我会遇到这个错误,请提前致谢。Expressiontype'DataRequest'isambiguouswithoutmorecontextfuncreport(_track:Track,completionHandler:@escaping(_error:NSError?)->Void){varheaders:[String:String]=[:]ifAuthManager.defaultAuthManager().isLoggedIn(){headers=["Authorization":"Bearer"+A

ios - Xcode 10、Swift 4.2 中的 "Ambiguous use"

我正在使用图书馆DropDown这是用Swift编写的iOS的MaterialDesign下拉菜单。我正在设置View的cornerRadius,如下所示,因为DropDown是UIView的子类。letdropDown=DropDown()dropDown.cornerRadius=10它在Xcode9.4中运行良好,但在升级到Xcode10后出现以下错误:AmbiguoususeofcornerRadius可能是什么问题? 最佳答案 根据您的描述,您正在尝试为UIView设置不直接应用于View的角半径。您可以像这样为UIVie

swift - 被 Swift 中的 Ambiguous Reference Member Reference 错误搞糊涂了

鉴于此工作区示例:importFoundationimportCoreBluetoothclassSomething:NSObject,CBPeripheralDelegate{varperipheral:CBPeripheral!funcperipheral(peripheral:CBPeripheral,didUpdateValueForDescriptordescriptor:CBDescriptor,error:NSError?){}funcfoobar(){self.peripheral.writeValue([],forDescriptor:0)//Iusearealval

ios - Swift 3 中的 "Ambiguous Reference To"错误

下午好,我正在尝试编写一个音乐播放应用程序,我正在尝试在其中实现一些名为“STK音频播放器”的开源代码,该代码是用ObjectiveC编写的。尝试从导入的源调用方法时,我收到以下编译错误。“对成员游戏的模糊引用”importUIKitclassViewController:UIViewController{varaudioPlayer=STKAudioPlayer()overridefuncviewDidLoad(){super.viewDidLoad()//Doanyadditionalsetupafterloadingtheview,typicallyfromanib.letson

arrays - 运行 XCTests 时出现 "Ambiguous use of ' MYFUNCTION( )'"错误

我在尝试运行XCTests时遇到几个函数的错误。例如,我有一个简单的数组扩展来提取一个唯一的数组:publicextensionCollectionTypewhereGenerator.Element:Hashable{///Returnsthecollectionwithduplicatevaluesin`self`removed.varunique:[Generator.Element]{get{varseen:[Generator.Element:Bool]=[:]returnself.filter{(element)->Boolinreturnseen.updateValue(