• 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
Casting from NSArray to a custom class
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Casting from NSArray to a custom class


  • Subject: Casting from NSArray to a custom class
  • From: SGGSCC-BIT <email@hidden>
  • Date: Tue, 15 Feb 2005 00:15:02 -0800 (PST)
  • Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys

Hi all,
 I am new to Objective C programming. I have a query regarding type conversion. I need to convert elements of NSArray to a particular class/ interface/ struct type.
 Actually I am using IDL. In the C++ implementation, a particular function returns a list of objects , lets say, "(mystruct*) some_function(int a , int b);". I have to implement the same in Objective C. Similar function in Obj-C will return an (NSArray*) type object. Now, I want the data in a list of "mystruct" objects. That means(i presume) I will have to convert from type "NSObject" to "mystruct".
 I have tried using implicit and explicit {"(mystruct *) someobject;" )} casting but it doesn't work. I tried using [NSObject poseAsClass] function, but it didn't work either. I think I will need something like the "reinterpret_cast" of C++. Kindly let me know how to go about it. Am I missing something trivial?
 Any kind of help or suggestions will be highly appreciated.
Thanks and Regards,
Rohit.


Do you Yahoo!?
Yahoo! Mail - now with 250MB free storage. Learn more.
 _______________________________________________
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: Casting from NSArray to a custom class
      • From: "M. Uli Kusterer" <email@hidden>
  • Prev by Date: NSTextField and NSTextView different notifications?
  • Next by Date: NSTableView question
  • Previous by thread: NSTextField and NSTextView different notifications?
  • Next by thread: Re: Casting from NSArray to a custom class
  • Index(es):
    • Date
    • Thread