• 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: Steve Checkoway <email@hidden>
  • Date: Sat, 31 Jan 2009 16:06:13 -0800


On Jan 31, 2009, at 2:57 PM, Peter Blazejewicz wrote:

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

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


No. Now you're comparing two pointers for equality and they won't be equal.

--
Steve Checkoway

    "Anyone who says that the solution is to educate the users
    hasn't ever met an actual user." -- Bruce Schneier




Attachment: smime.p7s
Description: S/MIME cryptographic signature

 _______________________________________________
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: Peter Blazejewicz <email@hidden>
References: 
 >Comparing a CFStringRef with a string literal? (From: Arnaud Nicolet <email@hidden>)
 >Re: Comparing a CFStringRef with a string literal? (From: Peter Blazejewicz <email@hidden>)

  • Prev by Date: Re: Comparing a CFStringRef with a string literal?
  • 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