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: 
Of course a method can return NSRange. But returning structures require special attention to the compiler because how the method is invoked is usually different (`objc_msgSend_stret` vs. `objc_msgSend`). 

Please make sure you declare `phrase` as

```
Phrase* phrase = ...;

```

so that the compiler knows `-rangeInString:…` is returning an NSRange, instead of 

```
id phrase = ...;

```

(Also, since you don't show which line the compiler errors, make sure the function using `return … == -1;` is returning a BOOL not NSRange.)
Yes, you can return C structs in methods. That is not the problem. Also, location is an NSUInteger and will never be -1. Use NSNotFound to test for that.

How is the instance of your Phrase object typed? Did you use `id` instead of `Phrase *`? Have you properly imported the Phrase header?

You should give us more information about the code that's giving the compile error.