KrauseFx / TSMessages

💌 Easy to use and customizable messages/notifications for iOS à la Tweetbot
http://krausefx.com
MIT License
4.87k stars 721 forks source link

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

Open theScud opened 10 years ago

theScud commented 10 years ago

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

KrauseFx commented 10 years ago

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.

mRs- commented 10 years ago

is this still an issue?

mafellows commented 10 years ago

I'm also getting the same issue.

mafellows commented 10 years ago

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.

mychrisdangelo commented 10 years ago

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

mRs- commented 10 years ago

I'll look into this.

srpoucse commented 10 years ago

any update on this issue ?

massdonati commented 10 years ago

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.
KrauseFx commented 10 years ago

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

massdonati commented 10 years ago

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?

gilthonweapps commented 10 years ago

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.

theScud commented 10 years ago

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.

SamStone92 commented 10 years ago

Any updates?

mRs- commented 9 years ago

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

mRs- commented 9 years ago

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