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

Adding text in a bitmap graphic context (on macOS) with Swift
swift nil form dictionary
UITextview edit mode in swift
Swift: Numeric Literals Decimal Floats Exponents [duplicate]
UDP Messaging in Swift Bytes Read But No Message
Swift- Copying an Object from a Third-party Library
Cast Swift Dictionary to CFDictionary
ActionPickerView get result
smooth scrolling PFQueryTableViewController
swift 3 table view with slide out menu
How can I access a struct member by passing its name as a function parameter in Swift?
fetch data from firebase swift
Can't push cell data in UITableViewCell to new UITableViewController
Are static classes supported by Swift?
Swift 3 - Is there any way to force method call on object?
saving “generic” object graph (Dictionary,Array,String,etc) to defaults without encoding?

Categories

HOME
semantic-ui
wmic
scipy
facebook-graph-api
backup
decorator
phpstorm
automated-tests
heap-memory
yocto
bro
simpy
constructor
click
uiactivityviewcontroller
game-physics
cpanel
x-frame-options
aptana
shippo
google-maps-android-api-2
rworldmap
restfb
delete-file
qsub
badge
opencart2.3
lync-2013
vcard
nesc
cortex-m3
mangodb
superagent
bxslider
sharp
encase
postgresql-9.2
dql
exiftool
powermta
pytest-django
encapsulation
startapp
amazon-clouddrive
tableau-server
gd
appstore-approval
gauss
mouseclick-event
spring-data-hadoop
heroku-postgres
garrys-mod
rsqlite
sql-import-wizard
tomee
software-product-lines
aescryptoserviceprovider
freetype2
database-backups
brython
faraday
portfolio
function-fitting
p-np
registrykey
js-cookie
programming-paradigms
pyrocms
calibration
rx-groovy
ticket-system
activity-streams
mser
errorprovider
adcolony
firebug-lite
coin-flipping
httpcontext
broadcasting
sanitization
nimrod
multiple-conditions
dynamic-data
crocodoc
enumerators
linkedhashset
vim-powerline
static-variables
expression-evaluation
getstring
signals2
viewdidload
pureftpd
boost-date-time
idictionary
visual-c++-2008-express
longjmp
divx

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