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

NSClassFromString help


  • Subject: NSClassFromString help
  • From: "William Zumwalt" <email@hidden>
  • Date: Wed, 13 Jun 2007 22:38:27 -0500

I've connected an action from my NSBrowser to this method which I
copied from the SimpleBrowser example (and it compiles), but it's not
compiling in my project.

So I'm trying to step through this thing line by line to get it
working, and as I try to look up 'Class' in the API docs, I'm not
finding anything there, or for super_class.

I keep getting the following error which compiles in the SimpleBrowser
example project ...
error: dereferencing pointer to incomplete type

- (IBAction) classBrowserChanged:(id) sender
{
   NSArray *selectionArray = [[networkBrowser path]
		componentsSeparatedByString:[networkBrowser pathSeparator]];

   NSString *selectedClassificationName = [selectionArray lastObject];

   Class selectedClassification =
NSClassFromString(selectedClassificationName);

   // Error appears on this line which I can't find any docs
   // for on Class or super_class
   Class superClass = selectedClassification->super_class;
   NSString *classificationName = @"";

   /*
   if (superClass) {
       classificationName = [NSString stringWithCString:superClass->name];
   }

	NSLog(@"classificationName %@", classificationName);

   [classNameField setStringValue:selectedClassificationName];
   [superclassNameField setStringValue:superclassName];
   // update the method and ivar browsers
   [ivarController setBrowserElements:
		InstanceVariableNamesForClass(selectedClass)];
   [methodController setBrowserElements:
		MethodNamesForClass(selectedClassification)];
    */

	return;
}
_______________________________________________

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


  • Follow-Ups:
    • Re: NSClassFromString help
      • From: Chris Suter <email@hidden>
  • Prev by Date: Re: First foray into HID, getReport() and setReport()
  • Next by Date: Re: NSClassFromString help
  • Previous by thread: Re: -[NSPredicate evaluateWithObject:] and NSArray
  • Next by thread: Re: NSClassFromString help
  • Index(es):
    • Date
    • Thread