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

tableview: search bar that uses indexPath.row
UITextField hide placeholder text or bring cursor to front when clicked swift
Find instance of class from class method
Best practices for handling errors when opening files inside Swift classes?
UITextField and UISearch Bar disable capital letters button - Swift
Swift keeps throwing errors, can't find out why
Swift pointer from ArraySlice
How call the function on UIBarButtonItem?
How to use GPUimage filter only in selected part of image? iOs(swift)
Admob BannerView float over PFQueryTableViewController
Closure closing strongly over a class type instance that go out of scope; can the instance be accessed somehow via the closure instance?
UIButton Heartbeat Animation
Decoding Firebase base64 Swift 2.0
CKSubscriptions and production container
Swift 2.0 autolayout constraints programmatically
Am I using a closure in the following code - Understanding Closures in Swift

Categories

HOME
ajax
crystal-reports
udp
google-contacts
fparsec
extract
couchdb-2.0
specflow
pygame
aruco
dropbear
unity2d
oclint
cartodb
cockroachdb
uiscrollview
squarespace
cratedb
google-people
scalaz7
http-method
jflex
rhandsontable
classpath
solidworks
superagent
body-parser
gettext
image-compression
wsadmin
dart-pub
ssh.net
jrules
excel-interop
g1gc
openweathermap
number-theory
defold
spell-checking
crystal-reports-8.5
rpostgresql
mcrypt
instruction-set
qos
bettercms
festival
build-process
windows-azure-pack
rstudio-server
spoofing
sun-codemodel
bluesnap
matcaffe
visual-studio-code
team-build
divide-by-zero
cpu-cores
stackframe
searchkick
hg-git
tilestache
proximity
rhel5
kendo-mvvm
mser
docopt
bsp
coin-flipping
kraken.js
visualstatemanager
mbox
uipickerviewcontroller
svcutil.exe
winrt-httpclient
nscolor
jqmobi
dynamic-binding
qss
transitive-closure-table
javascriptserializer
ninject-extensions
jpf
maven-ant-tasks
nssavepanel
zookeeper
newsstand-kit
msn
revert
rtsp-client
iphone-sdk-3.2
castle-validators
outlook-form





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