views:

54

answers:

1

I'm debugging an old OPENSTEP (YellowBox) app, written in Objective-C, running on Windows 2000, built with Project Builder. The only easy way I can find to write a string to disk in Obj-C is [NSString writeToFile], a Cocoa/iOS-era method which doesn't seem to have been written yet in the version of OPENSTEP that I'm compiling against (using Project Builder, YellowBox for Windows 1.0, v365).

I'd basically like to write the details of an exception to disk in an exception handler (using an NS_DURING..NS_HANDLER..NS_ENDHANDLER block).

EDIT:

Right now, I'm getting the following warning: 'NSString' does not respond to 'writeToFile:' Is it possible that there's some other cause (missing a #import, etc.)?

A: 

I thought -writeToFile:* was available as of the original OpenStep API. Actually, yes, at least one was (http://docs.sun.com/app/docs/doc/802-2112/6i63mn65q?l=Ja&a=view#05.Classes-243).

In any case, worse comes to worse, you could use the getString methods to fill a malloc()ed buffer then write that to disk.

bbum