我尝试将Firebase添加到我的iOS应用程序中,在添加之前,一切正常.后来我不断得到一个错误,声称构建失败."链接器命令失败,退出代码为1(使用-v查看)".所以我打开终端并使用详细信息来查看构建问题.这就是终端给了我的.
The following build commands failed:
Ld build/Swiffshot.build/Release-iphoneos/Swiffshot.build/Objects-normal/arm64/Swiffshot normal arm64
Ld build/Swiffshot.build/Release-iphoneos/Swiffshot.build/Objects-normal/armv7/Swiffshot normal armv7
(2 failures)
Run Code Online (Sandbox Code Playgroud)
我以前从未见过这个错误.我已经更新了所有的cocoapods,在添加Firebase之前一切正常...只是不确定发生了什么.任何帮助将不胜感激.
目前使用Swift和Xcode,供参考.
我正在为iOS构建随机密码生成器.在其中,按钮生成具有用户选择的特征的随机密码(例如,用于打开或关闭小写和大写字母,字符和符号等的开关).
用户界面看起来很棒,其余的代码工作顺利,但我无法让我的按钮实际生成一个随机的字母数字字符串.我有一个标签,其中包含一些占位符文本("您的密码"),当按下按钮时,它应该将其文本更新为随机字符串,但是我收到编译器错误:"未解析使用标识符'长度'"
这是按钮的当前代码:
@IBAction func generatePassword(_ sender: UIButton) {
let randomPasswordArray: NSString = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890"
let len = UInt32(randomPasswordArray.length)
var randomPassword = ""
for _ in 0 ..< length {
let rand = arc4random(len)
var nextChar = randomPasswordArray.character(at: Int(rand))
randomPassword += NSString(characters: &nextChar, length: 1) as String
}
passwordLabel.text = "randomPassword"
}
Run Code Online (Sandbox Code Playgroud)
谢谢!