Object-c cannot access viewcontroller-Collection of common programming errors

SOLUTION: Blogpost

Im using Titanium for application development and am trying to create a new module to extend application functions.

1) Module is up and running – FIX! 2) Adding “customs” / functions to module – ERR.

Im following this http://iosguy.com/2010/09/04/presenting-pdf-files-by-yourself/ and im really unsure where what how and why i need to put those functions, how i create the mentioned views and so on.

So heres what i got so far: Ive read that comas3breezepdfModule.m file is the one i need to work with so funcitons from the above link are pasted in this .m file as follows:

-(CGPDFDocumentRef)openDocument:(CFURLRef)url
{
    CGPDFDocumentRef myDocument = CGPDFDocumentCreateWithURL(url);
    if (myDocument == NULL) {
        return 0;
    }
    if (CGPDFDocumentIsEncrypted (myDocument)
        || !CGPDFDocumentIsUnlocked (myDocument)
        || CGPDFDocumentGetNumberOfPages(myDocument) == 0) {
        CGPDFDocumentRelease(myDocument);
        return 0;
    }
    return myDocument;
}

-(CGPDFDocumentRef)document 
{
    NSString *filePath = [[NSBundle mainBundle] pathForResource:@"presentation" ofType:@"pdf"];
    NSURL *url = [[NSURL alloc] initFileURLWithPath:filePath];
    CGPDFDocumentRef pdfdocument = [self openDocument:(CFURLRef)url];
    [url release];
    return pdfdocument;
}

- (void)load {
    UIViewController* controller = nil;
    NSInteger numberOfPages = CGPDFDocumentGetNumberOfPages([self document]);
    for (NSInteger pageIndex = 1; pageIndex

Originally posted 2013-11-09 21:07:30.