Question: I am trying to initialize a central manager instance to make an app with Bluetooth connectivity.

This is part of my code:

```
class ViewController: UIViewController, CBCentralManagerDelegate {
   var myCentralManager = CBCentralManager(delegate: self, queue: nil) //error on this line
   func centralManagerDidUpdateState(central: CBCentralManager!) { 
}

```

I get an error:

> 
> "Type 'ViewController -> () -> ViewController!' does not conform to protocol 'CBCentralManagerDelegate'
> 
> 
> 

The only method required by the protocol is `centralManagerDidUpdateState()` which I have added, so why do I get an error?

Answer: 
The error message is a little deceiving and is pointing you away from the actual issue. The problem is that you are accessing `self` in the initializer for a stored property, which you can't do like this.

One workaround is to simply declare the property without initializing it, and then move the assignment to the variable to somewhere like an initializer for your view controller, or one of your view controller's lifecycle methods, like viewDidLoad.
The code does not conform to the CBCentralManagerDelegate because the method "func centralManagerDidUpdateState(central: CBCentralManager!)" needs to be added to the class that is of type CBCentralManager. Not the view controller type. You have to create a new class of type CBCentralManager. Here is my solution to the problem you are referencing above:

```
//
//  ViewController.swift
//  BLECentral
//
//  Created by Sophronis Mantoles on 11/17/15.
//  Copyright Â© 2015 Sophronis Mantoles. All rights reserved.
//

import UIKit
import CoreBluetooth

class ViewController: UIViewController {

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.
}

@IBOutlet var statusLabel: UILabel!
var bleManager: BLEManager!

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

@IBAction func showStatus(sender: AnyObject) {

    func centralManager(central: CBCentralManager!,
        didDiscoverPeripheral peripheral: CBPeripheral!,
        advertismentData: [NSObject : AnyObject]!,
        RSSI: NSNumber!)
    {
    statusLabel.text = ("\(peripheral.name) : \(RSSI) dBm")
    }
        }
      }
  class BLEManager {
    var centralManager : CBCentralManager!
    var bleHandler : BLEHandler // delegate
    init() {
    self.bleHandler = BLEHandler()
    self.centralManager = CBCentralManager(delegate: self.bleHandler, queue:       nil)
      }
 }

class BLEHandler : NSObject, CBCentralManagerDelegate {
override init () {
    super.init()
}

func centralManagerDidUpdateState(central: CBCentralManager){
    switch (central.state)
    {
    case.Unsupported:
        print("BLE is not supported")
    case.Unauthorized:
        print("BLE is unauthorized")
    case.Unknown:
        print("BLE is Unknown")
    case.Resetting:
        print("BLE is Resetting")
    case.PoweredOff:
        print("BLE service is powered off")
    case.PoweredOn:
        print("BLE service is powered on")
    default:
        print("default state")
       }
    }
 }

```