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 define global final variable that not changes for all tests under class?
Swift3 : How to load html file to WKWebview from document directory
How to write own model mapper in Swift Language
how to display relative time in swift [duplicate]
Render Text with MetalKit
Using an overflow operator in Swift 3
How To Make Play/Pause Button on Apple TV Remote Play/Pause AVAudioPlayer
Swift optional binding constant names
Calculating Angle of Reach in Scenekit
Does _ArrayType or _ArrayProtocol not available in Swift 3.1?
Why doesn't it work to return in else? [closed]
How to write this code in swift 3.0. using For loop [duplicate]
Log Out automatically from the application when i login from another mobile device “swift - firebase”
call uiactivityviewcontroller with spritekit/skscene
print a string from an int, or… how to make an int equal to a specific string
When I add tableview to the ViewController,tableview is not added correctly

Categories

HOME
openssl
amazon-swf
wmic
survival-analysis
java-home
iis-7.5
spring-cloud-contract
openwrt
x-frame-options
squarespace
mod-pagespeed
phpbb
python-unicode
mousewheel
plupload
pycrypto
hhvm
header-files
bcrypt
hanami
kong
emv
mef2
ggmap
solidworks
pygooglechart
sharp
receipt
npm-shrinkwrap
ios-ui-automation
openpgp
jquery-cycle2
oscommerce
infusionsoft
soundjs
lexical-analysis
nsexception
bids
context-free-language
production-environment
cgcontext
maintenance
chrome-remote-desktop
jexl
pagefile
fontconfig
opencpu
polar-coordinates
rsqlite
build-process
android-navigationview
libreadline
windows-nt
gradle-eclipse
shipitjs
picking
dac
asp.net-mvc-partialview
mfc-feature-pack
aerogear
altbeacon
spservices
web-essentials
coldfusion-7
mirrorlink
sourcegear-vault
datasnap
android-snackbar
subresource-integrity
leadtools-sdk
harp
xaml-designer
google-earth-plugin
kallithea
activity-streams
scala-2.11
yahoo-boss-api
proxies
mbox
zipalign
xenocode
hamsterdb
prng
device-emulation
android-contextmenu
mvs
enumerators
css-tables
hashalgorithm
galaxy-tab
scalaxb
port-scanning
for-xml-path
mvccontrib-grid
boost-date-time
plinq
soft-keyboard





Mobile Apps Dev
Database Users
javascript
java
csharp
php
android


MS Developer
developer works
python
ios
c
html
jquery


RDBMS discuss