FetchRequest Template is changed automatically by editor
| Originator: | aaronconnolly | ||
| Number: | rdar://16037400 | Date Originated: | 2/11/2014 |
| Status: | Open | Resolved: | |
| Product: | Xcode | Product Version: | 5.0.2 |
| Classification: | Serious Bug | Reproducible: | Always |
Summary: If you look at a fetch request template in the Xcode 5 editor and that template has a clause that checks for a nil value on a field, the editor will often automatically change that expression to something else. This causes breaking changes in applications where the clause is used to query for data. Steps to Reproduce: 1. Create a new Master/Detail application and ensure CoreData option is checked. 2. Name the project 'CoreDataTest' 3. Open CoreDataTest.xcdatamodeld 4. Edit the pre-loaded Event entity and ensure that the pre-loaded 'timeStamp' attribute is Optional so that nil values will be allowed. 5. Create a new Fetch Request Template. Name the template 'fetchEvents' 6. Choose "Event" objects to return 7. Choose "All" of the following are true. 8. Click the plus button to add an expression. 9. Type 'timeStamp == nil' into the expression field. 10. Click the Event entity to switch out of the FetchRequest template editor. 11. Click the fetchEvents fetch request to edit the template again. Note the 'timeStamp == nil' expression is gone and replaced with 'timeStamp is <today's date>' Note also that you're not able to adjust the boolean logic around the clauses anymore because there is no "Any, All, None" option to select in the editor. You have to delete the expression altogether and start over. Expected Results: I expect that when I switch back and forth between the template editor that the expression I typed (or chose with the UI controls) should persist. Put another way if 'timeStamp == nil' is the expression I provided Xcode should not change the expression for me. Actual Results: Xcode's fetch request template editor changes the expression that I typed to something different altogether. Version: Xcode 5.0.2 (5A3005) Notes: The attached project demonstrates this issue. Configuration: This occurs in OS X 10.9.1 and with Xcode 5.0.2 (5A3005) Attachments: 'CoreDataTest.zip' was successfully uploaded.
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!