iOS Help - Application won't launch on iPhone!!!

Joined
Apr 27, 2011
Messages
2
Reaction score
0
Points
1
Hi, I'm trying to get my first application onto an iphone and its coming up errors and I can't spot them! It's fairly urgent too! Here's the Code:

//
// PDFExampleViewController.m
// Leaves
//
//

#import "PDFExampleViewController.h"
#import "Utilities.h"
#import "MyManager.h"

@implementation PDFExampleViewController

@synthesize myurl;

- (id)init {
if (self = [super init]) {

MyManager *sharedManager = [MyManager sharedManager];
myurl = sharedManager.myURL ;

CFURLRef pdfURL = CFBundleCopyResourceURL(CFBundleGetMainBundle(), sharedManager.myURL , NULL, NULL);
pdf = CGPDFDocumentCreateWithURL((CFURLRef)pdfURL);
CFRelease(pdfURL);
/*
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:mad:"Info"
message:sharedManager.myURL
delegate:nil
cancelButtonTitle:mad:"OK"
otherButtonTitles: nil];
[alert show];
[alert release];
*/
}
return self;
}

- (void)setURL:(NSString*)data;{
*myurl = *data;
}


- (void)dealloc {
CGPDFDocumentRelease(pdf);
[super dealloc];
}

- (void) displayPageNumber:(NSUInteger)pageNumber {
self.navigationItem.title = [NSString stringWithFormat:
@"Page %u of %u",
pageNumber,
CGPDFDocumentGetNumberOfPages(pdf)];
}

#pragma mark LeavesViewDelegate methods

- (void) leavesView:(LeavesView *)leavesView willTurnToPageAtIndex:(NSUInteger)pageIndex {
[self displayPageNumber:pageIndex + 1];
}

#pragma mark LeavesViewDataSource methods

- (NSUInteger) numberOfPagesInLeavesView:(LeavesView*)leavesView {
return CGPDFDocumentGetNumberOfPages(pdf);
}

- (void) renderPageAtIndex:(NSUInteger)index inContext:(CGContextRef)ctx {
if(ctx == nil)return nil;

CGPDFPageRef page = CGPDFDocumentGetPage(pdf, index + 1);
CGAffineTransform transform = aspectFit(CGPDFPageGetBoxRect(page, kCGPDFMediaBox),
CGContextGetClipBoundingBox(ctx));
CGContextConcatCTM(ctx, transform);
CGContextDrawPDFPage(ctx, page);
}

#pragma mark UIViewController

- (void) viewDidLoad {
[super viewDidLoad];
leavesView.backgroundRendering = YES;
[self displayPageNumber:1];
}

@end

The errors are incompatible pointer type and returning void

Any help would be greatly appreciated!!

TC
 
Joined
Feb 25, 2009
Messages
2,112
Reaction score
71
Points
48
Your Mac's Specs
Late 2013 rMBP, i7, 750m gpu, OSX versions 10.9.3, 10.10
It should tell you in the IDE and the output from the compiler exactly where those errors are (including file and line).
 

Shop Amazon


Shop for your Apple, Mac, iPhone and other computer products on Amazon.
We are a participant in the Amazon Services LLC Associates Program, an affiliate program designed to provide a means for us to earn fees by linking to Amazon and affiliated sites.
Top