ios - SCLAlertView 添加按钮问题

标签 ios objective-c cocoapods objective-c-blocks target

我在使用 CocoaPod SCLAlertView 时遇到问题。

由于某种原因,具有操作 block 功能的“addButton”不起作用。当点击 SCLAlertView 中的“注销”按钮时,操作 block 中的代码不会执行(“点击注销按钮”永远不会打印,并且该 block 中的代码也不会执行)。但是,它在我的其他应用程序中使用完全相同的代码。

无效的代码在这里:

enter image description here

这是 SCLAlertView addButton 不起作用的应用程序的 Podfile:

enter image description here

这是 SCLAlertView 正常工作的应用程序的 Podfile:

enter image description here

最佳答案

我早该意识到这就是问题所在。适用于 SCLAlertView 的 CocoaPod 版本是 0.8.2,而我的版本停留在 0.8.1,但我没有意识到。只需将其指定为具有以下内容的 pod 版本即可:

pod 'SCLAertView-Objective-C', '~> 0.8.2'

关于ios - SCLAlertView 添加按钮问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36949706/

相关文章:

objective-c - 如何修复 : "No visible @interface for ' FIRInstanceID' declares the selector 'token' "in iOS build in Flutter

objective-c - Objective-C 中的星期几

ios - Pod 安装,依赖项 `*****` 未在任何具体目标中使用

javascript - React Native ios运行问题

objective-c - 将 NSTextField 绑定(bind)到 NSString

swift - 使用桥接头创建 Pod

ios - 抛出异常观察 NSManagedObjectContext 保存

ios - 如何根据字体大小更改 UILabel 大小?

iphone - 在 iOS 中撰写新电子邮件时获取附加图像的内容 ID

ios - 快速添加谷歌地图 View ?