cocoa - How to get some values from CoreData-Entities to code -


I have created a unit with some attributes in my core device Imagine a tableview and a tied NSArrayController with both I Let me make my organization "examples" (and edit) My question is how can I get the value of these properties in my code? If there are more questions:

You must somehow get the reference of NSArrayController. If you are loading NIB yourself, then you can add an IBOutlet example to the class set in the form of NIB "file owner" when you load an NIB, you as the owner of the NIB "file owner "Give examples of class. If you are not loading your NIB (i.e. this is automatically filled by cocoa as your app's Mainamen Nib / xib), then make an example of your own class in the Nib and an IBOuttlet in that example Add. You can create an IBOutlet in your class like this:

  @interface MyClass: NSObject {// is not required to be a direct descendant of NSObject IBOutlet NSArrayController * array controller for its class of course; } @ Property (Maintenance, Non-Creative, Handwriting) IBOutlet NSArrayController * Array Controller; ... @end @implementation @ synthesize arrayController; - (Zero) Delok [[Array Controller Release]; [Super DeLoc]; } @end  

Connect to the IBOuttlet in your class for NSArrayController (in the first case, click-lip-click on the file owner or above in your case example in the second case) and drag the NSArrayController When you release the mouse, you will get a pop-up of ibotlets in the draw source. Select the iBotlet you created (for example, "Array Controller" in the example above).

A nid is filled (i.e. awakeFromNib is called in your class), through the array control outlet:

  NSArray * Content = [[self array controller] systematic object];  

And now you can do with values ​​in Array.


Comments