title: iOS blueTooth BLE connects to device but show services null
body: <p>I am connecting to a blueTooth system <a href="http://redbearlab.com/blemini/" rel="nofollow">http://redbearlab.com/blemini/</a></p>
  
  <p>to read some data from a service,</p>
  
  <p>how can I see the services available for this device,
  I have checked using <a href="https://itunes.apple.com/us/app/lightblue/id557428110?mt=8&amp;ign-mpt=uo=4" rel="nofollow">lightblue ios app</a> that my device have services.</p>
  
  <p>I can connect to my device, and get name, </p>
  
  <p>but my services array appear as null [checked is not null with above app]</p>
  
  <p>here my code</p>
  
  <pre><code>#import "MainViewController.h"
  
  
  
  @interface MainViewController ()
  
  @property (nonatomic, retain)UILabel *deviceName;
  @property (nonatomic, retain)UILabel *deviceUUID;
  @property (nonatomic, retain)UILabel *deviceConnected;
  
  
  @end
  
  @implementation MainViewController
  
  - (void)dealloc
  {
      [_deviceName release];
      [_deviceUUID release];
      [_deviceConnected release];
      [super dealloc];
  }
  
  - (void)viewDidLoad
  {
      [super viewDidLoad];
  
      [self initUI];
  
      self.view.backgroundColor = [UIColor lightGrayColor];
      NSLog(@"mgmt");
  
      self.manager = [[CBCentralManager alloc]initWithDelegate:self queue:nil];
  }
  
  
  
  - (void)centralManagerDidUpdateState:(CBCentralManager *)central {
  
      NSLog(@"centralManagerDidUpdateState");
  
      switch (central.state) {
          case CBCentralManagerStatePoweredOn:
  
              // Scans for any peripheral
              [self.manager scanForPeripheralsWithServices:nil options:nil];
  
              break;
          default:
              NSLog(@"Central Manager did change state");
              break;
      }
  }
  
  // device discovered
  - (void)centralManager:(CBCentralManager *)central didDiscoverPeripheral:(CBPeripheral *)peripheral advertisementData:(NSDictionary *)advertisementData RSSI:(NSNumber *)RSSI {
  
  
      NSLog (@"Discovered peripheral: %@", [peripheral name]);
      NSLog (@"UUID peripheral: %@", [peripheral UUID]);
  
      NSLog (@"peripheral services: %@", [peripheral services]);
  
  
      self.deviceName.text = [NSString stringWithFormat:@"Device Name: %@", [peripheral name]];
      self.deviceUUID.text = [NSString stringWithFormat:@"Device UUID: %@",[peripheral UUID]];
  
      [self.manager connectPeripheral:peripheral options:nil];
  }
  
  
  
  
  //scan for peripherals
  - (int) scanForPeripherals {
  
      NSLog(@"scanForPeripherals");
  
      NSDictionary *options = [NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:NO], CBCentralManagerScanOptionAllowDuplicatesKey, nil];
      [self.manager scanForPeripheralsWithServices:nil options:options];
      return 0;
  }
  
  
  - (void)centralManager:(CBCentralManager *)central didConnectPeripheral:(CBPeripheral *)peripheral {
      NSLog(@"Central Manager didConnectPeripheral");
  
  
      self.deviceConnected.text = @"Device Connected: YES";
  
      NSLog (@"UUID services: %@", [peripheral services]);
  
  
      // Clears the data that we may already have
      [self.data setLength:0];
      // Sets the peripheral delegate
      [self.activePeripheral setDelegate:self];
      // Asks the peripheral to discover the service
  
  //test! direct
      CBUUID  *serviceUUID    = [CBUUID UUIDWithString:@"D298E274-3CB0-2C5F-A0B0-A90D97304453"];
      NSArray *serviceArray   = [NSArray arrayWithObjects:serviceUUID, nil];
  
      [self.activePeripheral discoverServices:serviceArray];
  
  
  
  }
  
  
  
  - (void)peripheral:(CBPeripheral *)aPeripheral didDiscoverServices:(NSError *)error {
  
      NSLog(@"didDiscoverServices");
  
  
      if (error) {
          NSLog(@"Error discovering service: %@", [error localizedDescription]);
          //[self cleanup];
          return;
      }
  
  }
  
  - (void)peripheral:(CBPeripheral *)peripheral didDiscoverCharacteristicsForService:(CBService *)service error:(NSError *)error {
      NSLog(@"didDiscoverCharacteristicsForService");
  
      if (error) {
          NSLog(@"Error discovering characteristic: %@", [error localizedDescription]);
          //[self cleanup];
          return;
      }
  
  }
  
  //
  - (void)peripheral:(CBPeripheral *)peripheral didUpdateNotificationStateForCharacteristic:(CBCharacteristic *)characteristic error:(NSError *)error {
  
      NSLog(@"didUpdateNotificationStateForCharacteristic");
  
      if (error) {
          NSLog(@"Error changing notification state: %@", error.localizedDescription);
      }
  
  
  }
  
  
  
  - (void)didReceiveMemoryWarning
  {
      [super didReceiveMemoryWarning];
      // Dispose of any resources that can be recreated.
  }
  
  @end
  </code></pre>
  
  <p>So please advice on to why my services array is null?
  and how to access it to "read" thanks!</p>