• 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: Comparing a CFStringRef with a string literal?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Comparing a CFStringRef with a string literal?


  • Subject: Re: Comparing a CFStringRef with a string literal?
  • From: Peter Blazejewicz <email@hidden>
  • Date: Sat, 31 Jan 2009 23:57:37 +0100

hi Arnaud,
Cocoa-dev is better place for that. You could convert NSString to CFStringRef (both ways) to simplify your coding and work with Obj-C/ Cocoa only.


Shouldn't your code be written as (assuming "stringValue" is of NSString type):

CFStringRef efstr = (CFStringRef)([EFPW stringValue]);
if (efstr== CFSTR("my password")){
}

(#1 convert to CFStringRef #2 use CFSTR macro to wrap C string)

regards,
Peter Blazejewicz

On Jan 31, 2009, at 10:35 PM, Arnaud Nicolet wrote:

Hi,

I have this piece of code which does not work:

CFStringRef efstr=([EFPW stringValue]);

if (efstr=="my password"){
	NSLog("sjdskjf");
}

I also tried with strcmp and with a single "=". Even when both values are the same, the equal test fails. What I am doing wrong?
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden


  • Follow-Ups:
    • Re: Comparing a CFStringRef with a string literal?
      • From: Steve Checkoway <email@hidden>
References: 
 >Comparing a CFStringRef with a string literal? (From: Arnaud Nicolet <email@hidden>)

  • Prev by Date: XCode and ccache
  • Next by Date: Re: Comparing a CFStringRef with a string literal?
  • Previous by thread: Re: Comparing a CFStringRef with a string literal?
  • Next by thread: Re: Comparing a CFStringRef with a string literal?
  • Index(es):
    • Date
    • Thread