#601: hashes with empty values cannot writeToFile
--------------------------------+-------------------------------------------
Reporter: lastobe...@… | Owner: lsansone...@…
Type: defect | Status: closed
Priority: major | Milestone:
Component: MacRuby | Resolution: invalid
Keywords: |
--------------------------------+-------------------------------------------
Changes (by lsansone...@…):
* status: new => closed
* resolution: => invalid
Comment:
This is expected behavior. The same code in Objective-C also fails:
{{{
$ cat /tmp/t.m
#import <Foundation/Foundation.h>
int main(void)
{
NSLog(@"-> %d", [[NSDictionary dictionaryWithObject:[NSNull null]
forKey:@"foo"] writeToFile:@"/tmp/foo" atomically: YES]);
return 0;
}
$ gcc /tmp/t.m -o /tmp/t -fobjc-gc -framework Foundation
$ /tmp/t
2010-05-11 20:08:59.906 t[43283:107] -> 0
}}}
The documentation for -[NSDictionary writeToFile:atomically:] states:
{{{
This method recursively validates that all the contained objects are
property list objects (instances of NSData, NSDate, NSNumber, NSString,
NSArray, or NSDictionary) before writing out the file, and returns NO if
all the objects are not property list objects, since the resultant file
would not be a valid property list.
}}}
--
Ticket URL: <http://www.macruby.org/trac/ticket/601#comment:3>
MacRuby <http://macruby.org/>
_______________________________________________
MacRuby-devel mailing list
[email protected]
http://lists.macosforge.org/mailman/listinfo.cgi/macruby-devel