gpt4 book ai didi

ios - 为什么我的程序总是说 "unrecognised selector sent to instance"?

转载 作者:行者123 更新时间:2023-12-02 03:39:44 26 4
gpt4 key购买 nike

这是我的主要代码:

     @IBOutlet weak var avatar: UIImageView!
@IBOutlet weak var nickname: UIButton!

var tapGesture :UITapGestureRecognizer?

self.tapGesture = UITapGestureRecognizer(target: self, action: "dealTap:")
self.avatar.addGestureRecognizer(tapGesture!)

nickname.addTarget(self, action: "dealModifyNickname:", forControlEvents: UIControlEvents.TouchUpInside)


self.tapGesture = UITapGestureRecognizer(target: self, action: "dealTap:")
//tapGesture?.numberOfTapsRequired = 1
self.avatar.addGestureRecognizer(tapGesture!)

nickname.addTarget(self, action: "dealModifyNickname:", forControlEvents: UIControlEvents.TouchUpInside)



//modify avatar
func dealTap(sender:AnyObject){
println("dealTap,dealTap!!!")
println("i am %x",self)
Alterview.showMessage("a", delegate: self)
}

//modify nickname
func dealModifyNickname(sender:AnyObject){
Alterview.showmessage("a", subtitle: "a", cancelbutton: "a", delegate:self)
}

我可以随时修改我的头像和昵称,它不会崩溃,但是一旦我点击其他空间(空白区域),它就会崩溃。并且它说“-[__NSCFType dealTap:]:发送了无法识别的选择器到实例 0x15e72160"

最佳答案

您确实需要发布确切的消息,但我打赌这是因为您在 dealTap 中有 showMessage(大写 M),在 dealModifyNickname 中有 showmessage(小写 m)。

关于ios - 为什么我的程序总是说 "unrecognised selector sent to instance"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27374280/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com