I am playing with AppKit and NSDocument and I don't know why this is not working?:
I just wrote this and image is not nil but never loads any image, its size is always zero. Is this the correct method I have to implement to read files into my document? I need the path, not the data (NSData) because I plan to use other library to read other files.
Now I am trying to read PNGs, JPGs , none worked. ;(
- (BOOL) readFromURL:(NSURL *)url ofType:(NSString *)typeName error:(NSError **)outError{
NSImage *image = nil;
image = [[NSImage alloc] initWithContentsOfURL:url];
[imageView setImage:image];
[image release];
if ( outError != NULL ) {
*outError = [NSError errorWithDomain:NSOSStatusErrorDomain code:unimpErr userInfo:NULL];
}
return YES;
}
Thanks in advance.