NSImage * testImage = [[NSWorkspace sharedWorkspace]
iconForFileType:@"txt"];
NSImage * copyImage = [testImage copy];
NSLog(@"Image: %@ vs %@",testImage,copyImage);
NSEnumerator * ourEnumerator = [[testImage representations]
objectEnumerator];
NSBitmapImageRep * thisRep;
while (thisRep = [ourEnumerator nextObject]){
NSLog(@"Test image representation %x has bytes at %x",
thisRep,[thisRep bitmapData]);
}
ourEnumerator = [[copyImage representations] objectEnumerator];
while (thisRep = [ourEnumerator nextObject]){
NSLog(@"Copy image representation %x has bytes at %x",
thisRep,[thisRep bitmapData]);
}
All the addresses are different when I run this. NSImage -[copy] copies all the way down. And given that NSData has secondary messages that explicitly mention nocopy, you can have it either way.
@Daniel: Could be worse. I'm so behind the curve in hardware, my keyboard is still ADB!
Also, wasn't MS Dev studio non-free for the longest time? Even now, express has some limitations. In which case, the difference is that we'll eventually get IB 3.0 for free*, as opposed to always being the have-nots.
by Blain — Sep 29
NSImage * testImage = [[NSWorkspace sharedWorkspace] iconForFileType:@"txt"]; NSImage * copyImage = [testImage copy]; NSLog(@"Image: %@ vs %@",testImage,copyImage); NSEnumerator * ourEnumerator = [[testImage representations] objectEnumerator]; NSBitmapImageRep * thisRep; while (thisRep = [ourEnumerator nextObject]){ NSLog(@"Test image representation %x has bytes at %x", thisRep,[thisRep bitmapData]); } ourEnumerator = [[copyImage representations] objectEnumerator]; while (thisRep = [ourEnumerator nextObject]){ NSLog(@"Copy image representation %x has bytes at %x", thisRep,[thisRep bitmapData]); }
All the addresses are different when I run this. NSImage -[copy] copies all the way down. And given that NSData has secondary messages that explicitly mention nocopy, you can have it either way.
@Daniel: Could be worse. I'm so behind the curve in hardware, my keyboard is still ADB!
Also, wasn't MS Dev studio non-free for the longest time? Even now, express has some limitations. In which case, the difference is that we'll eventually get IB 3.0 for free*, as opposed to always being the have-nots.
*Okay, $129, most likely.