CocoaInt: NSMutableDictionary is difficult to use with new headers
Original Reporter info from Mantis: zpeterson @boramis
-
Reporter name: Zoë Peterson
Original Reporter info from Mantis: zpeterson @boramis
- Reporter name: Zoë Peterson
Description:
With the new Cocoa headers, instantiating an NSDictionary or NSMutableDictionary no longer finds the correct symbols, and gives errors about NSArray that don't make any sense in context.
The attached project compiles correctly in FPC 3.0.4 but fails with the current trunk (rev 42765)
var dict: NSDictionary; mDict: NSMutableDictionary; begin dict := NSDictionary.dictionaryWithContentsOfFile(path); dict := NSDictionary.alloc.initWithContentsOfFile(path); // ERROR: got "NSArray" expected "NSDictionary" dict := NSDictionary(NSDictionary.alloc).initWithContentsOfFile(path); dict := NSMutableDictionary.dictionaryWithContentsOfFile(path); mDict := NSMutableDictionary.dictionaryWithContentsOfFile(path); // ERROR: got "NSDictionary" expected "NSMutableDictionary" dict := NSMutableDictionary.alloc.initWithContentsOfFile(path); // ERROR: got "NSArray" expected "NSDictionary" mDict := NSMutableDictionary.alloc.initWithContentsOfFile(path); // ERROR: got "NSArray" expected "NSDictionary"