草庐IT

Delegate

全部标签

ios - App Delegate 因 Firebase 初始化而崩溃

我收到导致AppDelegate崩溃的错误Terminatingappduetouncaughtexception'com.google.greenhouse',reason:'ErrorDomain=com.google.greenhouseCode=-102"UnabletocorrectlyconfiguresubspecAnalytics"UserInfo={NSLocalizedFailureReason=TrackingIDmustnotbenilorempty.,NSLocalizedDescription=Unabletocorrectlyconfiguresubspe

ios - App Delegate 因 Firebase 初始化而崩溃

我收到导致AppDelegate崩溃的错误Terminatingappduetouncaughtexception'com.google.greenhouse',reason:'ErrorDomain=com.google.greenhouseCode=-102"UnabletocorrectlyconfiguresubspecAnalytics"UserInfo={NSLocalizedFailureReason=TrackingIDmustnotbenilorempty.,NSLocalizedDescription=Unabletocorrectlyconfiguresubspe

ios - 在 Swift 中覆盖 UIScrollView 的委托(delegate)属性(就像 UICollectionView 一样)

UIScrollView有一个符合UIScrollViewDelegate的委托(delegate)属性protocolUIScrollViewDelegate:NSObjectProtocol{//...}classUIScrollView:UIView,NSCoding{unowned(unsafe)vardelegate:UIScrollViewDelegate?//...}UICollectionView使用不同类型的UICollectionViewDelegate覆盖此属性protocolUICollectionViewDelegate:UIScrollViewDelegat

ios - 在 Swift 中覆盖 UIScrollView 的委托(delegate)属性(就像 UICollectionView 一样)

UIScrollView有一个符合UIScrollViewDelegate的委托(delegate)属性protocolUIScrollViewDelegate:NSObjectProtocol{//...}classUIScrollView:UIView,NSCoding{unowned(unsafe)vardelegate:UIScrollViewDelegate?//...}UICollectionView使用不同类型的UICollectionViewDelegate覆盖此属性protocolUICollectionViewDelegate:UIScrollViewDelegat

swift - 'ViewController' 类在 swift 中没有初始化器

当我这样做时得到编译器的投诉classViewController:UIViewController{vardelegate:AppDelegateoverridefuncviewDidLoad(){super.viewDidLoad()//Doanyadditionalsetupafterloadingtheview,typicallyfromanib.//self.appDelegate=UIApplication.sharedApplication().delegate;}@IBActionfuncgetData(sender:AnyObject){}@IBActionfuncL

swift - 'ViewController' 类在 swift 中没有初始化器

当我这样做时得到编译器的投诉classViewController:UIViewController{vardelegate:AppDelegateoverridefuncviewDidLoad(){super.viewDidLoad()//Doanyadditionalsetupafterloadingtheview,typicallyfromanib.//self.appDelegate=UIApplication.sharedApplication().delegate;}@IBActionfuncgetData(sender:AnyObject){}@IBActionfuncL

C# - 匿名委托(delegate)

像匿名方法一样,我使用“delegate”关键字声明的委托(delegate)是匿名委托(delegate)吗?namespaceTest{publicdelegatevoidMyDelegate();classProgram{staticvoidMain(string[]args){DelegateTesttst=newDelegateTest();tst.Chaining();Console.ReadKey(true);}}classDelegateTest{publiceventMyDelegatedel;publicvoidChaining(){del+=delegate{Co

C# - 匿名委托(delegate)

像匿名方法一样,我使用“delegate”关键字声明的委托(delegate)是匿名委托(delegate)吗?namespaceTest{publicdelegatevoidMyDelegate();classProgram{staticvoidMain(string[]args){DelegateTesttst=newDelegateTest();tst.Chaining();Console.ReadKey(true);}}classDelegateTest{publiceventMyDelegatedel;publicvoidChaining(){del+=delegate{Co

c# - 为什么 C# 三元运算符不能与委托(delegate)一起工作?

分支选择函数时,使用三元运算符选择函数可能有意义,但这是不可能的。为什么?publicclassDemo{protectedboolbranch;protectedvoiddemo1(){}protectedvoiddemo2(){}publicActionDoesntWork(){returnbranch?demo1:demo2;}}编译器产生以下错误:Cannotimplicitlyconverttype`methodgroup'to`System.Action' 最佳答案 问题是demo1不是一个简单的表达式,它是一个方法。并

c# - 为什么 C# 三元运算符不能与委托(delegate)一起工作?

分支选择函数时,使用三元运算符选择函数可能有意义,但这是不可能的。为什么?publicclassDemo{protectedboolbranch;protectedvoiddemo1(){}protectedvoiddemo2(){}publicActionDoesntWork(){returnbranch?demo1:demo2;}}编译器产生以下错误:Cannotimplicitlyconverttype`methodgroup'to`System.Action' 最佳答案 问题是demo1不是一个简单的表达式,它是一个方法。并