I'm quite new to the `Objectivce-C` and I was wondering what is the correct way of `memory management` in a **`static library`** without ARC.
Lets say my library has a method that returns `NSString*`:

```
- (NSString *) foo
{
    ...
    NSString *result = [[NSString alloc] initWithString:@"bar"];
    return [result autorelease];
}

```

So as far as I understand, since `foo` allocated the `NSString` it also needs to release it (or queue it for releasing). `NSString` is a return value, so the only thing I can do is to `autorelease` it. This creates a problem: if library is used in a command line tool, the developer needs to know that `foo` needs an `@autoreleasepool` otherwise calling `foo` multiple times inside main `@autoreleasepool` with eat up memory. This seems to me like I'm delegating memory management from library to the app which seems like a terrible thing to do. Is there a better way to do this? Or can I somehow make it obvious for the developer that `foo` needs an `@autoreleasepool`?