Re: error: expected method to write dictionary element not found on object of type 'NSMutableDictionary *

1,266 views
Skip to first unread message

Christopher Lloyd

unread,
Mar 28, 2013, 6:05:40 PM3/28/13
to cocotr...@googlegroups.com, ea...@rtcollab.com
Hi,

The containers don't implement support for  the new subscripting, should be fairly simple to do, the methods are explained here:


The NSMutableDictionary doc's describe their implementation, same as objectForKey/setObject:forKey:

Chris


On Wednesday, March 27, 2013 4:44:38 PM UTC-4, ea...@rtcollab.com wrote:
I have been trying to port an Objective-C program from Apple Xcode 4.5.2 which compiles perfectly to Linux CentOS 6.4 using Cocotron.  I am using the GNUstep runtime with clang 3.3.  I am getting hundreds of "expected method to write..." errors.  For example:

/root/GenealogyText/Library/
Source/Analysis/GTActionTable.m:38:5: error: expected method to write dictionary element not found on object of type 'NSMutableDictionary *'
    _functionMap[entry.name] = entry;
    ^
/root/GenealogyText/Library/Source/Analysis/GTActionTable.m:49:17: error: expected method to read dictionary element not found on object of type 'NSMutableDictionary *'
        entry = _functionMap[name];
                ^
/root/GenealogyText/Library/Source/Analysis/GTActionTable.m:66:37: error: expected method to read dictionary element not found on object of type 'NSMutableDictionary *'
        GTActionTableEntry* entry = _functionMap[key];
                                    ^

The Apple compiler is happy with this newer way of writing this.  If I revert back the following it compiles on CentOS fine:

 //    _functionMap[entry.name] = entry;
      [_functionMap setObject: entry forKey: entry.name];

//        entry = _functionMap[name];
          entry = [_functionMap objectForKey: name];

//        GTActionTableEntry* entry = _functionMap[key];
          GTActionTableEntry* entry = [_functionMap objectForKey: key];

I guess my question boils down to knowing if this functionality has been added and I am just missing something or if it is not possible to do at this point? With hundreds of these to change, it is a daunting task.  I am hoping that someone with a lot more experience than me will have an answer that would make that unnecessary.

Thanks in advance for anyone that can shed some light on this.

Earl






Reply all
Reply to author
Forward
0 new messages