Skip to content

Instantly share code, notes, and snippets.

@threeve
Created May 23, 2011 15:00
Show Gist options
  • Save threeve/986829 to your computer and use it in GitHub Desktop.
Save threeve/986829 to your computer and use it in GitHub Desktop.
#import <Foundation/Foundation.h>
@interface Foo : NSObject
@end
@implementation Foo
- (NSString*)description;
{
return @"this\nhas\nnewlines";
}
@end
int main (int argc, const char * argv[])
{
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
NSArray *foos = [NSArray arrayWithObjects:[[Foo new] autorelease], [[Foo new] autorelease], nil];
NSLog(@"foos: %@", foos);
// Actual output:
// 2011-05-23 09:59:23.863 Logged[1074:a0f] foos: (
// "this\nhas\nnewlines",
// "this\nhas\nnewlines"
// )
// Expected:
// 2011-05-23 09:59:23.863 Logged[1074:a0f] foos: (
// "this
// has
// newlines",
// "this
// has
// newlines"
// )
[pool drain];
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment