• 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
+class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

+class


  • Subject: +class
  • From: Keith Bauer <email@hidden>
  • Date: Thu, 13 Feb 2003 10:23:14 +1300

I'm having strange problems with +class. The following code causes this error:

warning: invalid receiver type `struct _objc_class *'
warning: passing arg 1 of pointer to function from incompatible pointer type

----

@interface Element : NSObject
...
@end

@interface Element (XMLLoading)
...
@end

@interface DocumentElement : Element
...
@end

@interface DocumentElement (XMLLoading)
...

- (void)appendChild:(id)child;

@end

@implementation DocumentElement (XMLLoading)

...

- (void)appendChild:(id)child
{
Class elementClass = [Element class];
...
}

@end

----

I can happily use DocumentElement or NSString in place of Element in the call to +class. I've checked the preprocessor output to make sure that I don't have any macros causing funny problems or anything.

What's particularly strange is that the same code works in another file. I'm baffled.

Any ideas?

Thanks,
Keith
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Prev by Date: Re: [OT] Re: Extending Safari
  • Next by Date: Subclassing a Cocoa class while in a Java package
  • Previous by thread: Re: [OT] Re: Extending Safari
  • Next by thread: NSComboBox allows no selection?
  • Index(es):
    • Date
    • Thread