• 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
Triggering a Core Data Store action ...
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Triggering a Core Data Store action ...


  • Subject: Triggering a Core Data Store action ...
  • From: thx316 <email@hidden>
  • Date: Sat, 5 Feb 2011 17:00:41 -0500

Hello.



How do I trigger a Core Data Store action when importing the contents of a
standard .txt file into an NSTextView via NSOpenPanel?



This is how I write the contents of a file to the textView. The text does
not remain associated with the sourceView entry, and I cannot save this
contents of the textView. However If I paste text into the textView or type
text, everything works as expected. I'm binding the textView's Value to the
array controller, the attribute is a String. I also tried setting the
textView's attribute to Binary using the Data binding. I am able to
retain/save data with various objects in my application except for the
imported text.



thx.


-(IBAction)doOpen:(id)sender

{

    NSOpenPanel *panel = [NSOpenPanel openPanel];
    [panel setRequiredFileType:@"txt"];

     if ([panel runModal] == NSOKButton) {
             NSString *fileName = [panel filename];

          if ([[fileName pathExtension] isEqualToString:@"txt"]) {
                    [textView readRTFDFromFile:fileName];

                            theFormat = PlainText;}
     }

    return;
_______________________________________________

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: Re: NSUndoManager retain/release of arguments - ad infinitum
  • Next by Date: Re: NSUndoManager retain/release of arguments - ad infinitum
  • Previous by thread: Re: Debugging Allocations. Was:NSUndoManager
  • Next by thread: Escape in NSTableView cell
  • Index(es):
    • Date
    • Thread