开发者

Quick question about auto-generated code via core data

I have two entities Company and Em开发者_开发技巧ployees. Company has a 1-to-many relationship with employees. An almost exact question was asked here however it doesnt answer my question :(. Like in that question, xcode in Company.m generates 4 almost exactly the same methods. However, the prototypes are not included in Company.h which leads me to believe that this is either

  • An error and that company.h requires the 4 prototypes for the void functions described in.
  • Intended and those 4 methods are only usable in the .m file? If so how to add many employees to a company.

Standing by for any clarifications. Thanks!


Typically I just set the company on the employee when creating the employees.

[newEmployee setValue:company forValue:@"company"];

this will trigger the relationship both ways and add the employee to the companies set of employees.

or since you've subclassed it.

newEmployee.company = company;
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜