我有2个项目,最近注意到滚动tableview并不顺利。它并不可怕,但不尽如人意。在iphone 4s上运行项目非常流畅。我的单元设置确实有2个图像和一个日期格式化程序,但它在4s上运行良好的事实令人困惑。有没有其他人遇到过这个问题。我已经在线查看,但没有找到任何解决方案。我曾尝试一次一件地拿出物品,但没有运气。
var current : message
var subject : String
var body : String
var status = "sent"
if sentorreceived == "received" {
status = Array.messages[indexPath.row].isread
current = Array.messages[indexPath.row]
} else {
status = sentArray.messages[indexPath.row].isread
current = sentArray.messages[indexPath.row]
}
let cell = tableView.dequeueReusableCellWithIdentifier("reuseIdentifier", forIndexPath: indexPath) as! inboxcell
subject = current.subject
body = current.body
let thecorrectdate = self.datehelper(current.date)
cell.bodyfield.text = body
cell.subjectfield.text = subject
cell.datefield.text = thecorrectdate
cell.fromfield.text = current.from
if current.messagetype == "PAGE" {
cell.priority.hidden = false
} else {
cell.priority.hidden = true
}
if current.attachments.count == 0 {
cell.paperclip.hidden = true
} else {
cell.paperclip.hidden = false
}
var status = "sent"
if sentorreceived == "received" {
status = Array.messages[indexPath.row].isread
} else {
status = ArraySent.messages[indexPath.row].isread
}
var imagestring : String?
switch status {
case "SENT":
imagestring = "SentMessageiOSIcon"
case "DELIVERED":
imagestring = "DeliveredMessageiOSIcon"
case "REPLIED":
imagestring = "RepliedSentMessageiOSIcon"
case "READ":
imagestring = "ReadMessageSentiOSIcon"
case "FAILED":
imagestring = "FailedMessageiOSIcon"
case "PAGEROFF":
imagestring = "OffMessageiOSIcon"
default:
imagestring = "SentMessageiOSIcon"
}
if sentorreceived == "sent" {
let theimage = UIImage(named: imagestring!)
cell.envelope.contentMode = UIViewContentMode.ScaleAspectFit
cell.envelope.clipsToBounds = true
cell.envelope.image = theimage
} else {
if status == "DELIVERED" {
let theimage = UIImage(named: "UnreadMessageiOSIcon")
cell.envelope.contentMode = UIViewContentMode.ScaleAspectFit
cell.envelope.clipsToBounds = true
cell.envelope.image = theimage
} else {
let theimage = UIImage(named: "ReadMessageiOSIcon")
cell.envelope.contentMode = UIViewContentMode.ScaleAspectFit
cell.envelope.clipsToBounds = true
cell.envelope.image = theimage
}
}
return cell
}
答案 0 :(得分:1)
原来,它与代码无关。我需要在手机上运行从9.0.2到9.1的更新。