Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: understanding conversions between CF and NS datatypes



On Aug 29, 2008, at 2:28 PM, Allen Curtis wrote:

Based on the information in the "interchangable data types" document, Would it be possible to do the following?

  NSMutableArray serialPorts = [[NSMutableArray alloc] init];
  GetSerialPortPaths(serialServices, (CFMutableArrayRef)serialPorts);
  printf("Found %d serial ports\n", [serialPorts count]);

NSMutableArray *serialPorts...

It has to be a pointer.

This way I do not have multiple copies. The NSMutableArray is populated directly.

You didn't have multiple copies in the first place; that was your problem. You had *1* object that you were looking at from 2 different perspectives, but treating it as if it were 2 objects.


And to answer your question, yes, the above should work (with my correction applied).

--
randy

A: Because it messes up the order in which people normally read text.
Q: Why is top-posting such a bad thing?
A: Top-posting.
Q: What is the most annoying thing in e-mail?
_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please 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:
http://lists.apple.com/mailman/options/cocoa-dev/email@hidden

This email sent to email@hidden
References: 
 >understanding conversions between CF and NS datatypes (From: "Allen Curtis" <email@hidden>)
 >Re: understanding conversions between CF and NS datatypes (From: Randall Meadows <email@hidden>)
 >Re: understanding conversions between CF and NS datatypes (From: "Allen Curtis" <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.