Re: Compile error
Re: Compile error
- Subject: Re: Compile error
- From: James Gregurich <email@hidden>
- Date: Sun, 8 Apr 2007 09:12:43 -0700
you only allocate class instances by pointer in objc.
On Apr 8, 2007, at 9:04 AM, Hrishikesh Muruk wrote:
Hi
I am a complete novice at Objective-c (But I do have reasonable
coding experience in C/C++).
I get the following compile error for a class I defined
"error: statically allocated instance of Objective-C class"
Class:
foo.h
@interface foo : NSObject {
@protected
NSString name;
}
-(void) doNothing;
@end
foo.m
@implementation foo
- (void) doNothing {
}
@end
The error goes away when I change name to "NSString* name".
Can I only declare object pointers in Objective-C? Just plain
objects are not allowed?
Thanks
Hrishi
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
40mac.com
This email sent to email@hidden
_______________________________________________
Cocoa-dev mailing list (email@hidden)
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:
This email sent to email@hidden
References: | |
| >Compile error (From: Hrishikesh Muruk <email@hidden>) |