• 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
Using NSClassFromString with a Custom Class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Using NSClassFromString with a Custom Class


  • Subject: Using NSClassFromString with a Custom Class
  • From: Steve Anderson <email@hidden>
  • Date: Sun, 11 Jun 2006 23:48:22 +1000

In my Objective-C Cocoa app I am trying to use my custom Java class 'HelloWorldJava', but it doesn't seem to be getting loaded (or even found) using the following code:

   Class javaClass = NSClassFromString(@"HelloWorldJava");
   helloworldjava = [[javaClass alloc] init];


Yet, the following does work:

   javaClass = NSClassFromString(@"java.lang.String");
   NSString *aString = [[javaClass alloc] init];


Everything is compiling OK.

Regards
Steve
_______________________________________________
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


  • Follow-Ups:
    • Re: Using NSClassFromString with a Custom Class
      • From: "Finlay Dobbie" <email@hidden>
    • Re: Using NSClassFromString with a Custom Class
      • From: Andreas Monitzer <email@hidden>
  • Prev by Date: Re: String Literals and KVC
  • Next by Date: Re: Using NSClassFromString with a Custom Class
  • Previous by thread: Re: String Literals and KVC
  • Next by thread: Re: Using NSClassFromString with a Custom Class
  • Index(es):
    • Date
    • Thread