Question: Are there any libraries to parse Textile (Textile to HTML) which will work in an Objective C iPhone app? C libraries will work too.

**Update:** I couldn't find any sufficiently developed libraries in C/Obj-C, but I did find one written in Javascript, which I used through an invisible UIWebView.

Link: [Javascript textile parser](http://jrm.cc/extras/live-textile-preview.php)

Answer: 
> 
> Can a method return an NSRange?
> 
> 
> 

Yes.

> 
> This method is called within the Phrase object by other methods without problems. … When I call this method from outside the class I get a compile error. … The compiler says 'incompatible types in assignment'.
> 
> 
> 

Remember to `#import` Phrase.h into the implementation file where you're talking to a Phrase object. Otherwise, the compiler doesn't know about your `rangeOfString:forString:goingForward:` method and *assumes* that it returns `id`. It needs the `@interface` in the header file to *know* that the method returns `NSRange`.

Assuming that your phrase object is in an instance variable, you probably declared the Phrase class with `@class Phrase;` in the header file where you declared the ivar. That's a forward declaration; it tells the compiler that a class named “Phrase” exists (so that a declaration like `Phrase *myPhrase` will be legal), but it doesn't tell the compiler anything else about it. To do that, you need to import the header.

The general rule, for instances of class A knowing about instances of class B, is for A's header (A.h) to forward-declare class B with `@class`, and A's implementation (A.m) to import B's header (B.h).

A different case is when A is a subclass of B. You need the `@interface` to make a subclass, so in this case and this case only, A.h must import B.h. Since it's importing the header for B, it does not need to forward-declare B.
I don't think this is the answer, but NSRange.location is declared as NSUInteger. By comparing it to -1, you are comparing an unsigned value to a signed value.

The only other answer I can think of is that the .m file you are making the call from has not imported the header Phrase.h. Now, I know you believe it has, but the compiler is saying otherwise. Try running the preprocessor on the file to see what it is actually importing. (right click in an editor containing the .m file - preprocess is near the bottom of the context menu that pops up).