Generated swift code does not have generic information for set / ordered set relationships
| Originator: | brianaking | ||
| Number: | rdar://27220502 | Date Originated: | 07-Jul-2016 09:36 AM |
| Status: | Open | Resolved: | |
| Product: | Developer Tools | Product Version: | Xcode 8 beta 2 |
| Classification: | UI/Usability | Reproducible: | Always |
Summary: When Xcode generates swift code, it does not contain any type information about the class contained in the relationship. This is very painful in the new swift world. If you write your own declaration, and define a to-many relationship as `var relationship: Set<MyRelatedMO>`, things work great. An Apple Engineer stated that this is problematic because it does not use the core-data internal set that has faulting behavior, however, it appears to behave the same in practice. The first time the set is accessed, the entire content of the set is loaded (monitored via -com.apple.CoreData.SQLDebug 1) . I tried this on a relationship with 100,000 items on both the NSSet API and on the object defined as a Set object. The engineer seemed to indicate that this was not a safe practice, but everything appears to work fine. Steps to Reproduce: Generate a to-many relationship and look at the generated code. Expected Results: The generated code should have type information for the relationships Actual Results: The generated code does not have the type information Regression: This is not a regression. Notes: Provide additional information, such as references to related problems, workarounds and relevant attachments.
Comments
Please note: Reports posted here will not necessarily be seen by Apple. All problems should be submitted at bugreport.apple.com before they are posted here. Please only post information for Radars that you have filed yourself, and please do not include Apple confidential information in your posts. Thank you!