• 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
Re: Converting NSArray of NSString elements into binary?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Converting NSArray of NSString elements into binary?


  • Subject: Re: Converting NSArray of NSString elements into binary?
  • From: Scott F Bayes <email@hidden>
  • Date: Wed, 3 Oct 2007 11:23:55 +0900

Very summary! But not really ostracism.

In my case, the file name was generated by a primitive c program on a PC, and is guaranteed to be straight ASCII; I should have mentioned that in my original response, but I had made my decision about how to acquire the char * version of the file name many months ago, and forgot that I'd already examined the issue (I did know it was deprecated, but forgot).

The bigger risk of course is that the deprecated method might turn into a pumpkin, perhaps when a new Xcode is released. Oops! This is October already...

Thanks for the reminder :-)

Although it's still not clear exactly what use will be made of the data in the end...

From what I saw in his post, it may be pixel data from some other program, stored in the file as ASCII decimal values. That's what mine is.


ScottB

On Oct 2, 2007, at 12:39 , mmalc crawford wrote:


On Oct 1, 2007, at 7:27 PM, Scott F Bayes wrote:

At the risk of summary ostracization by the list,
[...]
	[fileName getCString:fname];

Well, here's the summary ostracism:

*Do not use getCString.*

It's deprecated. See <http://developer.apple.com/documentation/ Cocoa/Reference/Foundation/Classes/NSString_Class/ DeprecationAppendix/AppendixADeprecatedAPI.html#//apple_ref/occ/ instm/NSString/getCString:>.

If you want to retrieve the characters, specify an encoding or use getCharacters:.
In the current context, dataUsingEncoding: looks like it may meet the OP's needs.
Although it's still not clear exactly what use will be made of the data in the end...


mmalc





_______________________________________________

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:
This email sent to email@hidden


References: 
 >Converting NSArray of NSString elements into binary? (From: "R.L. Grigg" <email@hidden>)
 >Re: Converting NSArray of NSString elements into binary? (From: Nick Zitzmann <email@hidden>)
 >Re: Converting NSArray of NSString elements into binary? (From: "R.L. Grigg" <email@hidden>)
 >Re: Converting NSArray of NSString elements into binary? (From: Scott F Bayes <email@hidden>)
 >Re: Converting NSArray of NSString elements into binary? (From: mmalc crawford <email@hidden>)

  • Prev by Date: Re: Converting NSArray of NSString elements into binary?
  • Next by Date: Re: Where are the boundaries of Cocoa and how are the boundaries perceived ?
  • Previous by thread: Re: Converting NSArray of NSString elements into binary?
  • Next by thread: Re: Converting NSArray of NSString elements into binary?
  • Index(es):
    • Date
    • Thread