• 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: Almost! to the end
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Almost! to the end


  • Subject: Re: Almost! to the end
  • From: John Love <email@hidden>
  • Date: Thu, 14 Jan 2010 14:08:09 -0500

I tracked down NSException.  Appscript posts a "NSRangeException" Exception which applies in my case.  So, a simple @try .. @catch pair around each row does the trick.

Thanks again and again ..

John Love

=====

On Jan 12, 10, at 10:33 AM, John Love wrote:

> Thanks to many, many folk, I am at the very end of my project .. calculating an Excel spreadsheet, cell by cell .. with the calculations done in a background thread .. using either +detachNewThreadSelector and/or NSPorts with NSPortMessages, or even a NSOperationQueue.  Tried all 3 approaches just for the sake of learning, and they all work.
>
> It's definitely been quite an education for me and quite an exercise in patience for all you folks.
>
> Oh, one more thing .. I use HAS's appscript application, ASTranslate, to convert my previous! AppleScript Studio code to Cocoa .. and it really works.
>
> After completing each row's worth of calculations, I test for the existence of both Excel and the spreadsheet .. in case the user prematurely quits the app or closes the spreadsheet .. and it works like a charm .. if quitting or closing, a message appears in my doc window.
>
> EXCEPT, if the user quits the app or closes the spreadsheet in the middle of completing the calculations for each row before I have a chance to do the appropriate testing.  Even if I burden my code by testing before each cell in the entire row, I still (theoretically) could encounter a quit or a close in the middle of a cell's calculation.  Clearly, getting or setting the value in a cell of a spreadsheet doc that is closed crashes my app.
>
> My very initial thoughts focus on NSError, except HAS's ASTranslate app does not seem to include a built in NSError object, such as is passed to NSDocument's -readFromURL.
>
> Any help out there for this worst-case scenario?  Thanks in advance.
>
> John Love
> Touch the Future! Teach!
>

John Love
Touch the Future! Teach!


_______________________________________________

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

  • Prev by Date: IBLibraryObjectTemplate
  • Next by Date: Core Video CIFilters/ playback / compression suggestions?
  • Previous by thread: Almost! to the end
  • Next by thread: NSFileHandle weirdness on 10.5 ...
  • Index(es):
    • Date
    • Thread