Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8524497
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T07:42:10+00:00 2026-06-11T07:42:10+00:00

I have the following code: OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)attrDictionary, (CFTypeRef *)&value); which causes

  • 0

I have the following code:

 OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)attrDictionary, (CFTypeRef *)&value);

which causes an error of:

Implicit conversion of an indirect pointer to an Objective-C pointer to 'CFTypeRef *' (aka 'const void **') is disallowed with ARC

Any idea on how to fix this? I have tried changing CFTypeRef * to an id * but it didn’t work out

Here’s the full method:

+ (NSData *)keychainValueForKey:(NSString *)key {
  if (key == nil) {
    return nil;
  }

  NSMutableDictionary *attrDictionary = [self attributesDictionaryForKey:key];

  // Only want one match
  [attrDictionary setObject:(id)kSecMatchLimitOne forKey:(id)kSecMatchLimit];

  // Only one value being searched only need a bool to tell us if it was successful
  [attrDictionary setObject:(id)kCFBooleanTrue forKey:(id)kSecReturnData];

  NSData *value = nil;
  OSStatus status = SecItemCopyMatching((CFDictionaryRef)attrDictionary, (CFTypeRef *)&value);
  if (status != errSecSuccess) {
    DLog(@"KeychainUtils keychainValueForKey: - Error finding keychain value for key. Status code = %d", status);
  }
  return [value autorelease];
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T07:42:12+00:00Added an answer on June 11, 2026 at 7:42 am

    You can just cast it to void *:

    OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)attrDictionary,
        (void *)&value);
    

    If you’re using Objective-C++ you probably have to cast it twice:

    OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)attrDictionary,
        (CFTypeRef *)(void *)&value);
    

    Or you can use a temporary variable:

    CFTypeRef cfValue = NULL;
    OSStatus status = SecItemCopyMatching((__bridge CFDictionaryRef)attrDictionary, &cfValue);
    NSData *value = (__bridge id)cfValue;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have following code: Tools::Logger.Log(string(GetLastError()), Error); GetLastError() returns a DWORD a numeric value, but
I have following code using hibernate to throw a custom exception on error and
I have following code: public abstract class Operand<T> { public T Value { get;
I have following code to find if row is selected, which is selected and
I have following code: inline bool match(const std::wstring & text1, const std::wstring & text2)
I have following Code Block Which I tried to optimize in the Optimized section
I have following code which works fine in iPhone application but in iPad I
i have following code in which, i am fetching the data from the sqlite
I have following code in initialization im = imread('Image02.tif'); figure(); imagesc(im); colormap(gray); [hImage hfig
I have following code <div id=main> <div id=one> </div> <div id=two> </div> <div id=three>

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.