TSMessages icon indicating copy to clipboard operation
TSMessages copied to clipboard

+[UIColor colorWithHexString:]: unrecognized selector sent to class

Open theScud opened this issue 11 years ago • 15 comments

Hi have setup this project to use TSMessage through cocoapods . Unfortunately The App crashes at line number 168:

[[UIColor colorWithHexString:current[@"backgroundColor"]];

i have followed the steps extactly , and everything was working fine till i did a pod update. now nothing seems to work i even tried reverting to an older version. 0.9.2 but still crashing. Please find my podfile below .

#Taget Xcode Project file
xcodeproj 'proj.xcodeproj'

#BasePods to be used with all targets

platform :ios, 7.0

pod 'AKSegmentedControl'
pod 'TSMessages'
pod 'AFNetworking'
pod 'MBProgressHUD'
pod 'SVProgressHUD'
pod 'Facebook-iOS-SDK'
pod 'libPhoneNumber-iOS'
pod 'Objection'

target :DebugDistribute do
    link_with 'proj','projE'
    pod 'TestFlightSDK', '~> 2.2.1-beta'
end

target :Tests  do
    link_with 'projTests', 'projETests'
    pod 'Kiwi', '~> 2.2.3'
    pod 'OCMock', '~> 2.2.2'
end

target :ReleaseCandidate do
    link_with 'proj','projE'
    pod 'Mixpanel', '~> 2.3.0'
    pod 'TestFlightSDK', '~> 2.2.1-beta'
end

target :Release  do
    link_with 'proj','projE'
    pod 'Mixpanel', '~> 2.3.0'
end

i am using 4 pod target for 4 build different build configuration [Reference https://github.com/CocoaPods/CocoaPods/issues/731]. and i am adding the pods targets through OTHER_LINKER_FLAGS. i'm don't if that is causing issues. All my other pods seem to be working fine. Please Let me know if you need any additional details

theScud avatar Feb 14 '14 10:02 theScud

When it crashes there, the color value seems to be empty. Check if the json file for the design was properly delivered with the app.

KrauseFx avatar Feb 22 '14 09:02 KrauseFx

is this still an issue?

mRs- avatar Apr 03 '14 13:04 mRs-

I'm also getting the same issue.

mafellows avatar Apr 03 '14 19:04 mafellows

Also, @KrauseFx I checked to make sure the Hex color was getting passed into the method correctly. It was. Seems to be an issue with the HXColor library. If I pass in a standard

[UIColor colorWithRed:Green:Blue:Alpha]; 

everything works perfectly.

Should note: I produced the same crash on all devices I tested on. An an iOS 7.0.3 iPhone 5S and the simulator.

mafellows avatar Apr 04 '14 01:04 mafellows

I'm also getting the same issue. I installed manually (without cocoapods) successfully.

mychrisdangelo avatar Apr 06 '14 03:04 mychrisdangelo

I'll look into this.

mRs- avatar Apr 07 '14 05:04 mRs-

any update on this issue ?

srpoucse avatar Jul 03 '14 21:07 srpoucse

Apparently there is something wrong in here self.backgroundBlurView.blurTintColor = [UIColor colorWithHexString:current[@"backgroundColor"]];

on line 166 of TSMessageView.m

po [UIColor colorWithHexString:current[@"backgroundColor"]]
error: Execution was interrupted, reason: Attempted to dereference an invalid ObjC Object or send it an unrecognized selector.
The process has been returned to the state before expression evaluation.

massdonati avatar Jul 04 '14 20:07 massdonati

It's working fine over here... As @mafellows mentioned, it seems to have a naming conflict with other classes.

KrauseFx avatar Jul 06 '14 15:07 KrauseFx

The wired thing is that this happens only if I use cocoapods to install it, if I do it manually it works fine. Any Idea?

massdonati avatar Jul 07 '14 09:07 massdonati

Hi, Any update on this bug? I have the same problem here. If I install it using cocoapods, it doesn't work. If I install it manually, it works.

gilthonweapps avatar Aug 28 '14 08:08 gilthonweapps

Hi,

In my case the issue was with the Xcode Project file. It got corrupt or something . Anyway created a new project file and reinstalled using pods and everything was right as rain.

theScud avatar Aug 31 '14 08:08 theScud

Any updates?

SamStone92 avatar Oct 17 '14 19:10 SamStone92

Sorry about that, i'm pretty busy right now. But i will definitive looking into this pretty soon.

mRs- avatar Nov 10 '14 09:11 mRs-

In the new HexColors Version it will be pre-fixed with hx_

mRs- avatar Nov 10 '14 09:11 mRs-