{"id":611,"date":"2022-08-30T15:04:14","date_gmt":"2022-08-30T15:04:14","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/object-c-cannot-access-viewcontroller-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:04:14","modified_gmt":"2022-08-30T15:04:14","slug":"object-c-cannot-access-viewcontroller-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/object-c-cannot-access-viewcontroller-collection-of-common-programming-errors\/","title":{"rendered":"Object-c cannot access viewcontroller-Collection of common programming errors"},"content":{"rendered":"<p>SOLUTION: Blogpost<\/p>\n<p>Im using Titanium for application development and am trying to create a new module to extend application functions.<\/p>\n<p>1) Module is up and running &#8211; FIX! 2) Adding &#8220;customs&#8221; \/ functions to module &#8211; ERR.<\/p>\n<p>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.<\/p>\n<p>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:<\/p>\n<pre><code>-(CGPDFDocumentRef)openDocument:(CFURLRef)url\n{\n    CGPDFDocumentRef myDocument = CGPDFDocumentCreateWithURL(url);\n    if (myDocument == NULL) {\n        return 0;\n    }\n    if (CGPDFDocumentIsEncrypted (myDocument)\n        || !CGPDFDocumentIsUnlocked (myDocument)\n        || CGPDFDocumentGetNumberOfPages(myDocument) == 0) {\n        CGPDFDocumentRelease(myDocument);\n        return 0;\n    }\n    return myDocument;\n}\n\n-(CGPDFDocumentRef)document \n{\n    NSString *filePath = [[NSBundle mainBundle] pathForResource:@\"presentation\" ofType:@\"pdf\"];\n    NSURL *url = [[NSURL alloc] initFileURLWithPath:filePath];\n    CGPDFDocumentRef pdfdocument = [self openDocument:(CFURLRef)url];\n    [url release];\n    return pdfdocument;\n}\n\n- (void)load {\n    UIViewController* controller = nil;\n    NSInteger numberOfPages = CGPDFDocumentGetNumberOfPages([self document]);\n    for (NSInteger pageIndex = 1; pageIndex<\/code><\/pre>\n<p id=\"rop\"><small>Originally posted 2013-11-09 21:07:30. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>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 &#8211; FIX! 2) Adding &#8220;customs&#8221; \/ functions to module &#8211; 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 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-611","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/611","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=611"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/611\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=611"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=611"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=611"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}