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

How to filter objects by string comparison in Swift
Date Picker Only Works After Clicking out of Text Field
optional variable in class definition
Swift UILabel word wrap for Chinese?
Not able to get results for spotlight search for user tags with NSMetadataquery and kMDItemUserTags
swift: how to generate arm7 or arm64 from the command line
Dictionary<string,Dictionary> in swift 3.0 giving nil when tried to add a dict [duplicate]
Unwrap optional inside switch case [duplicate]
why is my xib button not aligning with my simulator keyboard screen?
Xcode swift login with Facebook SDK app not loading
Get next value on a map?
Swift Detecting a Change in a Textfield from a .xib file
Firebase retrieve data multiple filters [duplicate]
Swift3 setting constraints relative to parent view of parent view
Using a string parameter to describe class property
Generic dictionary extension error - ambiguous reference to subscript

Categories

HOME
json
google-apps-script
nlp
checkbox
jrebel
bro
simpy
schemacrawler
slim-3
ipfs
click
criteria
jboss7.x
gwtp
store
multiple-monitors
uisplitviewcontroller
mule-studio
propel2
plupload
flexboxgrid
epicor
python-textprocessing
metis
codelite
pygooglechart
getjson
protobuf-net
rhomobile
precedence
mms
forecasting
mediawiki-extensions
jrules
google-account
android-maps-v2
encapsulation
maintenance
slot
etherpad
jszip
tomee
angularjs-ng-pattern
instruments
mercurial-hook
coordinate-transformation
mongo-c-driver
mfc-feature-pack
axes
git-rebase
qbfc
criteria-api
coypu
adobe-indesign
scrollspy
google-plus-one
jai
cpan
adcolony
bsp
coin-flipping
delphi-xe3
opensocial
lov
winrt-httpclient
visual-c++-2010-express
arangodb-php
bignum
nimrod
trimming
pep8
htmltextwriter
pys60
subtract
windows-phone-7-emulator
z-machine
supersized
flexicious
newsstand-kit
gtk2hs
zend-form-element
iphone-sdk-3.2
self-reference

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