Hi all,

I'm converting my garbage-collected document-based application to use Core Data. In my existing implementation, several NSViewControllers keep weak references to the NSDocument object by using the __weak attribute:

@interface MyController : NSViewController
        __weak MyDocument* document;
@end

This is so that when a document window is closed, the memory for the document is freed. This works fine.

The document in turn has a property specified like so:

@property (readonly) NSString* foo;

However, now that I've switched the document to be a subclass of NSPersistentDocument, I am getting compilation errors in my NSViewController subclass when it tries to access the foo property of the document:

document.foo = @"bar";

-> error: property 'foo' not found on object of type 'MyDocument *__attribute__((objc_gc(weak)))'

Why would this compiler error be occurring?

--
Rob Keniger



_______________________________________________

Cocoa-dev mailing list (Cocoa-dev@lists.apple.com)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to