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 do I check if a value is undefined in my Parse?
Swift Casting Generic to Optional with a nil value causes fatalError
How to convert degrees, minutes, seconds and direction to longitude and latitude coordinates?
Parse query results in error
How can I attach video or movie file then send email in swift
Stroke image in SKSpriteNode with path (Swift)
Swift: CoreData - unrecognized selector sent to instance when insert row
Creating a subclass of SKShapeNode
DateFormatter not working in ios By setting
Having a function return a mutable AnyObject
AeroGearOAuth2 Swift Retrieve Google Contacts
In Swift, how to set default date entry to today
Swift - cast one tuple to another
Use arrow key input for SceneKit game in Swift
Performing a method that uses variables that come from optional
Show Image from URL in detailView after selection in tableView

Categories

HOME
ssas-2012
semantic-ui
admin-on-rest
signalr
oauth
ipython
puppet
heap-memory
apple-numbers
hyperledger-fabric
currency
octopus-deploy
pca
click
xamarin-studio
iso
cosmicmind
glpk
android-toolbar
derived
scalaz7
url.action
header-files
rworldmap
memsql
tflearn
philips-hue
version-numbering
pep8-assembly
rowcount
helix-3d-toolkit
skygear
web-audio-api
fabric-digits
large-data
boilerplate
xamarin.uitest
dql
nstouchbar
jags
persistent
greenhills
openh264
ruby-on-rails-2
forerunnerdb
fedora20
castle-dynamicproxy
jcreator
addin-express
ingres
gradle-script-kotlin
rmongodb
chessboard.js
firepath
spark-cassandra-connector
mercurial-hook
clob
string-parsing
fps
project-online
group-concat
asymptote
hateoas
enyo
vips
zuora
app.xaml
evo
jericho-html-parser
python-winshell
abas
playscape
google-earth-plugin
mov
smartystreets
spdy
mimosa
visual-studio-addins
.net-cf-3.5
ftp4j
windows-update
carddav
graph-coloring
prng
tridion2009
lync-server-2010
android-4.0
attachevent
getusermedia
redirectstandardoutput
caliper
windows-phone-7-emulator
applicationcontext
hashalgorithm
search-path
symbol-server
querypath
surefire
savestate
multibyte-functions
openwysiwyg
dotproject

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