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

swift3 getting Initialization of immutable value 'task' was never used on URLSession.shared.dataTask(with: url!)
JTCalendar Memory Leak
Using a Timer in the background thread to update UI
UITableview with dynamic height cells & filling footer view
UINavigationBar changing to unexpected colors on scroll/transition
Passing Class.Type into a function Swift
Grand Central Dispatch
extracting value from IOPSCopyPowerSourcesInfo() swift
swift facebook education and occupation
Swift project unit testing fail
Swift 3 Uploading data to a server with Alamofire
How to get matrix values using Surge
Xcode Thread 1 EXC_BAD_ACCESS Code 1
Indoor-Navigation Swift3 [on hold]
Using LLVM C API in a Swift Xcode Project
Add protocol to struct after condition is met Swift 3

Categories

HOME
ibm-watson-cognitive
payment-gateway
scipy
warnings
steam
decorator
concourse
apollo
is-empty
jrebel
yocto
filter
user
ng-admin
structuremap
jboss-eap-7
gatsby
cosmicmind
pdo
riak
anychart
esql
thingsboard
k2
bcrypt
scalajs-react
ab-initio
data-conversion
dpi
thinking-sphinx
bxslider
hawtio
modulo
node-horseman
sidr
android-download-manager
flex4.5
nsexception
nashorn
control-flow-graph
lftp
finite-element-analysis
catia
pinvoke
ogre3d
text-classification
crystal-reports-8.5
nuget-server
quintus
keycode
nsfetchedresultscontrolle
webkit2
metalsmith
boost-hana
coordinate-transformation
mfc-feature-pack
except
sonarqube5.3
enyo
vips
rad
windowlistener
java-melody
temp-tables
microblaze
odftoolkit
fragment-tab-host
dmp
valence
android-json-rpc
gamepad
windows-mobile-6
bigint
ruboto
ftp4j
windows-update
code-conversion
returnurl
deploying
hibernate3
law-of-demeter
msgbox
noir
search-path
.app
rijndael
pantheios
querypath
external-assemblies
jquery-ui-button
visual-c++-2008-express
hmacsha1
system-codedom-compiler

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