GithubHelp home page GithubHelp logo

Comments (10)

mwaterfall avatar mwaterfall commented on July 29, 2024

Have you #imported the NSString+HTML.h category into your code?

from mwfeedparser.

testower avatar testower commented on July 29, 2024

Yes like this:

#import "NSString+HTML.h"

The GTMNSString+HTML is (sufficiently?) imported by NSString+HTML, so I assume I don't have to import it explicitly in my own code?

The following files are copied into my project:

GTMNSString+HTML.h
GTMNSString+HTML.m
NSString+HTML.h
NSString+HTML.m

Do I need anything else?

from mwfeedparser.

testower avatar testower commented on July 29, 2024

Here's how I'm trying to use it:

NSString *title = [[entry valueForKey:@"title"] stringByDecodingHTMLEntities];

from mwfeedparser.

mwaterfall avatar mwaterfall commented on July 29, 2024

Have you checked that [entry valueForKey:@"title"] is an instance of NSString?

from mwfeedparser.

testower avatar testower commented on July 29, 2024

Looks like it's actually NSMutableString, but could that be the problem? Can't check right now...

from mwfeedparser.

testower avatar testower commented on July 29, 2024

I did a copy on the NSMutableString, which should return a regular NSString. It did not fix the problem.

from mwfeedparser.

CMTaylor avatar CMTaylor commented on July 29, 2024

I'm getting an erro like this, too, after upgrading an old project to Xcode 4.3.2. My error is:
-[__NSCFString JSONFragmentValue]: unrecognized selector sent to instance 0x6994560
and as far as I can tell I have a correctly implemented Category on NSString that implements the JSONFragmentValue. I suspect that there's something new and different in the way Categories on built-in classes are implemented in Xcode 4.3.2. I also had a similar problem with a Category on NSNumber and ended up re-writing that as its own independent class (which worked fine).

Any ideas what may have changed to break code like this in Xcode 4.3.2?

from mwfeedparser.

CMTaylor avatar CMTaylor commented on July 29, 2024

In browsing the web for other possible solutions to this problem I found this:
SDWebImage/SDWebImage#85

And in the offered solutions there I saw this:

Adding the -all_load flag to 'Other Linker Settings' in my app project, as seen in the first answer here: http://stackoverflow.com/questions/3998483/objective-c-category-causing-unrecognized-selector

This "rang a bell" with my earlier work on my particular project in an older Xcode. It said somewhere that this "-all_load" flag was required. I checked and somehow it hadn't migrated properly to Xcode 4.3.2. I added this to the previously empty "Other Linker Settings" and instantly the exceptions went away and the project worked! Now I'm going to go back and undo my changes to the Category on NSNumber and see if that works the original way, too!

from mwfeedparser.

AbeEstrada avatar AbeEstrada commented on July 29, 2024

NSString+HTML is not compatible with Xcode 4.2 because GTMNSString+HTML isn't ARC compatible, it is using struct.

You can always add -fno-objc-arc to the files (https://code.google.com/p/google-toolbox-for-mac/wiki/ARC_Compatibility)

from mwfeedparser.

testower avatar testower commented on July 29, 2024

Awesome. I added -fno-objc-arcas build flag to GTMNSString+HTML.m and NSString+HTML.m under the Compile Sources settings in the Build Phases tab of my Target settings. That solved my problem. Thank you Abe!

from mwfeedparser.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.