swift


SwiftValue: ctFontRef unrecognized selector sent to instance


I am doing an chatting app by using Quick blox. I am not an expecting in code. when i run the app. The app gets crashed. I got an error. Chatting Message[1806:27316] -[_SwiftValue ctFontRef]: unrecognized selector sent to instance 0x600000253020
2017-05-16 10:23:38.982 Chatting Message[1806:27316] *** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[_SwiftValue ctFontRef]: unrecognized selector sent to instance 0x600000253020'
override func collectionView(_ collectionView: QMChatCollectionView, dynamicSizeAt indexPath: IndexPath, maxWidth: CGFloat) -> CGSize
{
let item: QBChatMessage? = chatDataSource.message(for: indexPath)
let viewClass: AnyClass = self.viewClass(forItem: item!)
var size: CGSize?
if viewClass == QMChatAttachmentIncomingCell.self || viewClass == QMChatAttachmentOutgoingCell.self
{
size = CGSize(width: CGFloat(min(200, maxWidth)), height: CGFloat(200))
}
else
{
// let attributedString: NSAttributedString? = self.attributedString(forItem: item!)
// size = TTTAttributedLabel.sizeThatFitsAttributedString(attributedString, withConstraints: CGSize(width: maxWidth, height: CGFloat(MAXFLOAT)), limitedToNumberOfLines: 0)
}
size = CGSize(width: CGFloat(min(200, maxWidth)), height: CGFloat(200))
return size!
}
override func collectionView(_ collectionView: QMChatCollectionView, minWidthAt indexPath: IndexPath) -> CGFloat
{
let item: QBChatMessage? = chatDataSource.message(for: indexPath)
var size: CGSize?
size = CGSize(width: CGFloat(1000), height: CGFloat(10000))
if item != nil
{
let attributedString: NSAttributedString? = item?.senderID == senderID ? bottomLabelAttributedString(forItem: item!) : topLabelAttributedString(forItem: item!)
size = TTTAttributedLabel.sizeThatFitsAttributedString(attributedString, withConstraints: CGSize(width: CGFloat(1000), height: CGFloat(10000)), limitedToNumberOfLines: 1)
}
return size!.width
}
override func collectionView(_ collectionView: QMChatCollectionView, layoutModelAt indexPath: IndexPath) -> QMChatCellLayoutModel
{
var layoutModel: QMChatCellLayoutModel = super.collectionView(collectionView, layoutModelAt: indexPath)
let item: QBChatMessage? = chatDataSource.message(for: indexPath)
layoutModel.avatarSize = CGSize(width: CGFloat(0.0), height: CGFloat(0.0))
if item != nil
{
let topLabelString: NSAttributedString? = topLabelAttributedString(forItem: item!)
let size1 = TTTAttributedLabel.sizeThatFitsAttributedString(topLabelString, withConstraints: CGSize(width: collectionView.frame.width, height: CGFloat.greatestFiniteMagnitude), limitedToNumberOfLines: 1)
layoutModel.topLabelHeight = size.height
}
return layoutModel
}

Related Links

Search Bar - filtering numeric value in swift
error: missing argument for parameter #1 in call (swift)
NSURLSession concurrent requests with Alamofire
Why need get/set when using Computed Properties in Swift, while we can code without them actually?
Trying to conform to StringLiteralConvertible
LLDB swift print object
Changing position.x causes skspritenode to not display
Wait until an asynchronous api call is completed - Swift/IOS
Read lines from big text file in Swift until new line is empty: the Swift way
how do i enable autofill password for a wkwebview
Multidimensional dictionaries possible in Swift?
Access instance constant in lazy constructor
Typecase regular Swift function to Curry Function
What's the most efficient way to determine if a Swift string is shorter than a certain length
Swift: array of dictionaries has count of 1 after initialization but should have 0 [duplicate]
Swift out of bounds array loop / catching exceptions?

Categories

HOME
arrays
tinyos
freepascal
wildcard
firebase-app-indexing
d
formal-verification
hana
matplotlib
h2
heap-memory
data-science-experience
websphere-liberty
flexbox
keystore
cockroachdb
cs-cart
activesync
scaling
jcl
propel2
ios10.3
jni
koa
nmake
rails-activerecord
tflearn
upnp
reactiveui
thinking-sphinx
gzip
devforce
protobuf-net
entity-system
web-audio-api
powershell-remoting
xen
.net-assembly
xamarin.uitest
parse-android-sdk
magiczoomplus
jquery-multidatespicker
datalog
service-fabric-stateful
3scale
production-environment
uiviewpropertyanimator
slot
photon-controller
httplib2
paas
collapsingtoolbarlayout
createobject
barcode-printing
libtiff.net
coremidi
firepath
django-filer
multifile-uploader
amf
dojox.charting
gherkin
emokit
spinlock
inet
galaxy
test-class
oai
rx-groovy
swift2.1
word-2013
android-search
alphablending
ghostdoc
dache
valence
crystal-reports-10
bfd
nservicebus4
nsmatrix
vertical-rhythm
astyanax
fraud-prevention
pep8
htmltextwriter
marmalade-edk
mozart-mvc
makefile-project
maven-ant-tasks
flexicious
scraperwiki
opengl-es-lighting
authenticode
dcpu-16
sendfile
recordset
scala-2.8
integer-promotion
divx

Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization
Database Dev&Adm
javascript
java
csharp
php
python
android
jquery
ruby
ios
html
Mobile App
Mobile App
Mobile App