Jump to content

Search the Community

Showing results for tags 'nsdictionary'.



More search options

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Delphi Questions and Answers
    • Algorithms, Data Structures and Class Design
    • VCL
    • FMX
    • RTL and Delphi Object Pascal
    • Databases
    • Network, Cloud and Web
    • Windows API
    • Cross-platform
    • Delphi IDE and APIs
    • General Help
    • Delphi Third-Party
  • C++Builder Questions and Answers
    • General Help
  • General Discussions
    • Embarcadero Lounge
    • Tips / Blogs / Tutorials / Videos
    • Job Opportunities / Coder for Hire
    • I made this
  • Software Development
    • Project Planning and -Management
    • Software Testing and Quality Assurance
  • Community
    • Community Management

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Delphi-Version

Found 1 result

  1. Hi there, I wanted to call the Bluetooth initWithDictionary and its option CBCentralManagerOptionShowPowerAlertKey; There is little information out there howto create the options for this call in the right way. CBCentralManager = interface(NSObject) ['{587D1855-5B53-43DA-91AF-AF9D93FFDB9F}'] ... function initWithDelegate(delegate: id; queue: dispatch_queue_t; options: NSDictionary): id; cdecl; overload; In XCode that looks quite straightforward, but what about Fmx ? let opts = [CBCentralManagerOptionShowPowerAlertKey: false] let manager = CBCentralManager(delegate: self, queue: nil, options: opts) Info's like this doesn't help much http://codeverge.com/embarcadero.delphi.firemonkey/help-rewrite-objective-c-proced/1046099 Using NSUserDefaults to access the info list properties seems not to work, returning nil. But is NSUserDefaults the right place to look for those keys ? var LDefaults: NSUserDefaults; LDict: NSDictionary; begin LDefaults := TNSUserDefaults.Wrap(TNSUserDefaults.OCClass.standardUserDefaults); LDict := LDefaults.dictionaryForKey( CBCentralManagerOptionShowPowerAlertKey ); // ! This (LDict) is nil if Assigned(lDict) then FCentralManager := TCBCentralManager.Wrap( TCBCentralManager.Alloc.initWithDelegate( GetObjectID, 0, LDict )) I used this function to get the key constant function CBCentralManagerOptionShowPowerAlertKey : NSString; begin Result := CocoaNSStringConst(libCoreBluetooth, 'CBCentralManagerOptionShowPowerAlertKey'); end; Other ways to construct this NSDictionary look to ugly to be true: LDict := TNSDictionary.Wrap( TNSDictionary.OCClass.dictionaryWithObjectsAndKeys( <<This is Pointer to object a nil-terminated list>>)); Maybe somebody can help with some useful hints, to find the right way to access such system options ?
×