• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: ObjC in gcc 4: warning about [SomeClass class]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: ObjC in gcc 4: warning about [SomeClass class]


  • Subject: Re: ObjC in gcc 4: warning about [SomeClass class]
  • From: Thomas Lachand-Robert <email@hidden>
  • Date: Mon, 2 May 2005 09:23:43 +0200


Le 2 mai 05 à 08:37, Robert Chin a écrit :

On May 1, 2005, at 8:28 AM, Thomas Lachand-Robert wrote:



So do you think it's a bug? And can you suggest a workaround?


It's not a bug. What you need is to tell the compiler that your class actually adheres to the NSObject protocol (which is separate from inheriting from the NSObject class, except that obviously if you inherit from NSObject, you automatically adhere to the NSObject protocol).


It would be nice if you could do:

@class <NSObject>;

But unfortunately, that won't work. But the idea is the same. Since you don't need to be able to access instance variables, you should be able to just include in your .m file:

@interface SomeClass<NSObject>
@end

which will tell the compiler all of the appropriate information. Not as clean looking, but it does work.


Thanks a lot, it actually does work!


Thomas Lachand-Robert ********************** email@hidden << Et le chemin est long du projet à la chose. >> Molière, Tartuffe.


_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Prev by Date: Re: Selector not working for me
  • Next by Date: Re: Selector not working for me
  • Previous by thread: Re: to NSTask or not to NSTask
  • Next by thread: Fwd: NSBezierPath and line intersection
  • Index(es):
    • Date
    • Thread