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.)
In response to some questions that are coming up:

```
#import <Foundation/Foundation.h>
#import "OverlayView.h"
#import "Phrase.h"
#import "TimerPaneView.h"

```

Is the header in the MainPane.h, the class header for where the call is being made.

In the header for MainPane.h, phrase is declared:

```
    Phrase              *phrase;

```

And in the implementation file, which, yes, imports the MainPane header:

```
phrase = [[Phrase alloc] init];

```

Is how the phrase class is being instantiated, in the initWithFrame method. I refer to the phrase object dozens and dozens of times, calling methods, referring to properties in this class, without problems. And no, the phrase object is never released until dealloc.

-- added: I thought I had found the problem: a collapsed section of code that never is called that had a legacy return value that was BOOL. This method originally returned BOOL, but was converted. But I eliminated it, and the problem remains. 

I should also say that I've refactored my way around this problem, but it remains a mystery...