• 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: IBAction deselects currently selected Core Data record?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: IBAction deselects currently selected Core Data record?


  • Subject: Re: IBAction deselects currently selected Core Data record?
  • From: Quincey Morris <email@hidden>
  • Date: Mon, 29 Sep 2008 09:00:19 -0700

On Sep 28, 2008, at 16:21, Michael LaMorte wrote:

I have a Core Data application with a subclass of NSManagedObject. The subclass has an IBAction that, when triggered, needs to get the value of several entity properties of the currently selected record.

I have the accessor methods declared properly in the declaration and implementation files, and they work fine from within other parts of the code, but when executing something like this:

- (IBAction)exportData:(id)sender {
	NSString *theData = [self projectName];
}

the running application errors out, and the value of projectName is nil.

What kind of error, and where precisely does it occur? Are there any error messages in the log?


On the face of it, there is something wrong with your code design here. A managed object is almost certainly part of your data model. An object that executes IBActions is almost certainly a controller. So, an IBAction in a managed object is ordinarily a no-no.

_______________________________________________

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: 
 >IBAction deselects currently selected Core Data record? (From: Michael LaMorte <email@hidden>)

  • Prev by Date: Re: Making NSTableView column headers editable
  • Next by Date: Re: Two questions about cocoa programming...
  • Previous by thread: IBAction deselects currently selected Core Data record?
  • Next by thread: How to get Safari Bookmarks in the code
  • Index(es):
    • Date
    • Thread