• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSURLRequest and WebKit/NSURLConnection crash
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSURLRequest and WebKit/NSURLConnection crash


  • Subject: Re: NSURLRequest and WebKit/NSURLConnection crash
  • From: Mark Christian <email@hidden>
  • Date: Wed, 05 Sep 2007 11:29:37 -0300

Hi, folks;
I've found the solution, and I thought I'd post it here in case it ever happens to anyone else.


The function at the end, [self loadURLRequest], loads urlRequest in the main frame of a WebView. It works as expected if the page has no frames, but if it does have a frame, you need to retain the frame you load the URL request in. Even though I was using [webView mainFrame], it's de-allocating when frames exist.

Thanks for everyone's suggestions.

Mark

On 4-Sep-07, at 4:59 PM, Mark Christian wrote:

Hi, folks;
I've got a weird crash that's driving me crazy. Hopefully someone out there can shed some light on the situation.


I have a method that navigates a WebView to a particular URL. Sometimes, it posts data along with the request, sometimes not. The POST data is sorted in an NSData called pendingData, and the function looks something like this:


if (pendingData == nil) { // Simple request urlRequest = [NSURLRequest requestWithURL:url]; } else { // POST request urlRequest = [NSMutableURLRequest requestWithURL:url]; [urlRequest setHTTPMethod:@"POST"]; // Encode data // (snipped) } [self loadURLRequest:urlRequest];

In the case where pendingData is nil, everything works perfectly. In the case where it's not nil, I get an NSURLConnection. My POST data encoding definitely works, because it has worked in the past -- something else got broken. Just setting the HTTP method to "POST" is enough to cause the crash.

Here's the crash log:
#0 0x90a594c7 in objc_msgSend ()
#1 0xbfffe9e8 in ?? ()
#2 0x92859ee4 in -[NSURLConnection(NSURLConnectionInternal) _sendCallbacks] ()
#3 0x92859ab5 in _sendCallbacks ()
#4 0x9082cf92 in CFRunLoopRunSpecific ()
#5 0x9082cace in CFRunLoopRunInMode ()
#6 0x92ded8d8 in RunCurrentEventLoopInMode ()
#7 0x92decfe2 in ReceiveNextEventCommon ()
#8 0x92dece39 in BlockUntilNextEventMatchingListInMode ()
#9 0x93293465 in _DPSNextEvent ()
#10 0x93293056 in -[NSApplication nextEventMatchingMask:untilDate:inMode:dequeue:] ()
#11 0x9328cddb in -[NSApplication run] ()
#12 0x93280d2f in NSApplicationMain ()
#13 0x0000231e in main (argc=1, argv=0xbffff88c) at /Users/mark/ Work/Provisioning/Macintosh/trunk/Provisioning Wizard/main.m:31


If anyone out there can help, I'd be really appreciative. Thank you in advance;
Mark
_______________________________________________


Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
40v1labs.com


This email sent to email@hidden
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


References: 
 >NSURLRequest and WebKit/NSURLConnection crash (From: Mark Christian <email@hidden>)

  • Prev by Date: Re: [ANN] RegexKit - An Objective-C Framework for Regular Expressions Using the PCRE Library
  • Next by Date: Re: Attributed Strings in Distributed Objects
  • Previous by thread: Re: NSURLRequest and WebKit/NSURLConnection crash
  • Next by thread: No meeting for Lake Forest cocoaheads 9/4, next meeting 10/2
  • Index(es):
    • Date
    • Thread