ios - Getting wrong minor and major value of estimote beacon -


I am working on Esteemot Beacon and I am working to find the nearest Beacon Minor and Major value to the demo app. But when I check the App of Examples of Estimates, I am receiving the appropriate principal and minor value, but when I use that code in my project, I was given an inaccurate minor and prime value.

This is my code: -

  typed enum: int {ESTScanTypeBluetooth, ESTScanTypeBeacon} ESTScanType; - (id) initWithScanType: (ESTScanType) scan type full: (zero (^) (ESTBeacon *)) complete {self = [super init]; If (self) {self.scanType = scanType; Self.completion = [closing copy]; } Healthy return; } - (zero) viewDidoadload [[Super Viewedload]; Self.beaconManager = [[ESTBeaconManager alloc] init]; Self.beaconManager.delegate = self; Self.region = [[[ESTBeaconRegion alloc] initWithProximityUUID: [[NSUIID ALOOC] Init WithUUID String: BECnUUD1] Identifier: @ A ???? All beacons ????]; If (self.scan type == ESTScanTypeBeacon) {[self.beaconManager startRangingBeaconsInRegion: self.region]; } And {{self. Beacon Manager StartStimet Beacons Discovery Forge Region: Self. Area]; } // Setup an additional after loading the view from your nibb} - (zero) viewDid size: (BOOL) animated {[super viewDidi size: animated]; Stops / * * after exiting the scene. * / [Self. Beacon Manager Bandrang Beacons Eniyaganj: Self. Area]; [Self. Beacon Manager ClosesStimetBeckonDiscovery]; } #pragma mark - ESTBeaconManager Representative - (zero) Beacon Manager: (ESTBeaconManager *) Manager did the Thorac Beacons: (NSArray *) area in Beacon: (ESTBeaconRegion *) area {self.beaconsArray = beacon; [TblView reload data]; } - (zero) Beacon Manager: (ESTBeaconManager *) Manager discovers bacon: (NSARRA *) beacon in regional: (ESTBEKONRJ * *) area {self. Beaconsare = Bacon; [TblView reload data]; } - (UITableViewCell *) Talikadrishy: (UITableView *) Table View Selforaatindpath: (NSIndexPath *) Suckankpth {static NSString * CellIdentifier = @ "cell"; __weak BeconsDetailCell * cell = (BeconsDetailCell *) [tableview dequeueReusableCellWithIdentifier: CellIdentifier]; If (cell == zero) {NSArray * nib = [[NSBundle mainBundle] loadNibNamed: @ "BeconsDetailCell" owner: self choice: zero]; Cell = [nib object at index: 0]; } East Beacon * Beacon = [Self. Beacon's ObjectItindex: IndexPath.ro]; // beacon name cell.lblBeaconname.text = @ "Estimate Beacon"; // Beacon Head NSString * strMajor = [NSString stringWithFormat: @ "% @", Beacon Major]; StrMajor = [strMajor stringByReplacingOccurrencesOfString: @ "- String: @" "]; Cell.lblBeaconMajor.text = strMajor; // Bacon NABARD NSSSING * Stringer = [NSSTING string with format: @"% @ ", Beacon. Minor]; StrMinor = [strMinor stringByReplacingOccurrencesOfString: @ "-" string: @ ""]; Cell.lblBeaconMinor.text = strMinor; // Beacon distance switch (Bacon permeacy) {Case CLProximity unknown: cell.lblBeaconDistance.text = @ "Unknown "; Breakage; case CLProximityFar: cell.lblBeaconDistance.text = @" fer "; break; case CLProximityNear: cell.lblBeaconDistance.text = @" pass "; rupture; case cloproximityimetate: El.lb.kidnestens.text = @ "instant"; breakdown; default: break;} return cell;}   

thanks in advance.

If you see the documentation for you that are major and minor NSNumber s and although an NSNumber can be evaluated in the string context The value can be obtained through the description method, this is not the right way to reach the numerical value

You

  should be used (if beacon.major! = Void) {cell.lblBeaconMajor.text = [NSString stringWithFormat: @ "% ld", [Beacon.me intValue]]; } And {cell.lblBeaconMajor.text = @ ""; } If (beacon mino! = Zero) {cell.lblBeaconMinor.text = [NSString stringWithFormat: @ "% ld", [Beacon. To intavalue]]; } And {cell.lblBeaconMinor.text = @ ""; }    

Comments

Popular posts from this blog

ios - Adding an SKSpriteNode to SKScene from a child SKSpriteNode -

Matlab transpose a table vector -

c# - Textbox not clickable but editable -