Welcome, guest! Login / Register - Why register?
Psst.. new poll here.
Psst.. new forums here.

Paste

Pasted by Michael ( 12 years ago )
- (void) getWeightData:(CBCharacteristic *)characteristic error:(NSError *)error
{
    NSData *data = [characteristic value];
    
    if([data length] > 0)
    {
        NSString *string=[[NSString alloc]initWithData:data encoding:NSUTF8StringEncoding];
        
        if(string)
        {
            NSLog(@"string looks like this %@", string);
        } else {
            NSLog(@"I've got no string converted");
        }
    } else {
        NSLog(@"I've got no value");
    }
}

 

Revise this Paste

Parent: 72952
Your Name: Code Language: