allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
08/05/13 10:16 AM (12 years ago)

NSURL error

I want to be able to open up pdf files in my app. My app compiles fine, but when I click on the link to open up the page in the simulator, the app pauses, and opens up main.m showing me a signal SIGABRT error. So I created breakpoints so I could find the error, and I found it in one of my leasingViewController.m file in my viewDidLoad method: - (void)viewDidLoad { [super viewDidLoad]; NSString *path = [[NSBundle mainBundle] pathForResource:@"pdf" ofType:@"pdf" inDirectory:@"Supporting Files"]; NSURL *url = [NSURL fileURLWithPath:path]; NSURLRequest *request = [NSURLRequest requestWithURL:url]; <<<error here! [leasingview loadRequest:request]; } I have searched every where to find a fix for this. I google the error and I find that I'm not alone, but no real fixes. Any have any idea whats going on here? Thanks
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/05/13 10:38 AM (12 years ago)
Hello, Opening PDF files in your app should work without any issues. Couple things to make sure of: * Make sure you've copied all your plugins, including the PDF plugin, into Xcode. Easiest way is to just drag the whole BT_Plugins folder into Xcode. * Ensure that your PDF files is in the BT_Docs folder, and that the folder itself is in Xcode. * Make sure that the filename for your PDF file is correctly configured in the control panel for that screen. Check those things out, and let us know if you're still having problems! You can also check the Debug console window for errors...it might be more helpful than setting breakpoints. David has done a great job commenting the code. Mark
 
allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
like
08/05/13 10:53 AM (12 years ago)
I have created this app from scratch. I got the same issues when i created the app in buzztouch. But the error was when I tried to open a custom class using the json snippet keeper, and no matter what i tried I could not get it to work. So I thought if I just created the app from scratch that it would fix the problem. That part of my app works but now I can do something as simple as open up a pdf file.
 
allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
like
08/05/13 11:25 AM (12 years ago)
I apparent have a memory issue. I just don't know how to fix it. self leasingViewController * 0x071801e0path NSString * 0x00000000 url NSURL * 0x000058e8
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/05/13 11:34 AM (12 years ago)
How big is the PDF? Maybe breaking it down into smaller chunks would help?
 
allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
like
08/05/13 11:39 AM (12 years ago)
Hi Mark Yeah I thought of that too, but the file size is only 111KB? I'm using ARC also. I'm missing something and it's probably small and stupid....lol. I just can't figure it out.
 
GoNorthWest
buzztouch Evangelist
Profile
Posts: 8197
Reg: Jun 24, 2011
Oro Valley, AZ
1,000,000
like
08/05/13 12:00 PM (12 years ago)
I'm at a loss, unfortunately!
 
allandriggers
Apple Fan
Profile
Posts: 188
Reg: Dec 13, 2012
Knoxville, TN
11,680
like
08/05/13 07:32 PM (12 years ago)
Yeah me too, but I will figure it out. Thanks Mark
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.