我使用BEMSimpleLineGraph Pod创建了一个折线图,但是,就我而言,无法弄清楚为什么x-Axis标签没有出现在任何比iPhone 5更新的设备上.
编辑:我应该提到默认的enableXAxisLabel = YES.
以下是布置图表的代码:
#import "WeightChartCell.h"
@implementation WeightChartCell
@synthesize viewCell, arrayPlots, myGraph, labelWeightHistory;
- (void)awakeFromNib {
}
- (void)layoutSubviews {
[super layoutSubviews];
float width = viewCell.bounds.size.width;
self.myGraph = [[BEMSimpleLineGraphView alloc] initWithFrame:CGRectMake(-20, 40, width+20, 150.0)];
self.myGraph.dataSource = self;
self.myGraph.delegate = self;
self.myGraph.colorTop = [UIColor whiteColor];
self.myGraph.colorBottom = [UIColor colorWithRed:190/255.0 green:218/255.0 blue:246/255.0 alpha:1];
self.myGraph.colorLine = [UIColor colorWithRed:124/255.0 green:181/255.0 blue:236/255.0 alpha:1];
self.myGraph.colorPoint = [UIColor colorWithRed:124/255.0 green:181/255.0 blue:236/255.0 alpha:1];
self.myGraph.widthLine = 3;
self.myGraph.sizePoint = 10;
self.myGraph.alwaysDisplayDots = YES;
self.myGraph.colorXaxisLabel = [UIColor …Run Code Online (Sandbox Code Playgroud) 蓝牙制造商告诉我,我需要将以下内容发送到外围设备:'P'(0x50)
我如何使用 Objective-C 做到这一点以及如何获得响应?
最好有代码示例。
这几乎回答了我的问题,但没有给出任何代码示例:peripheral writeValue: forCharacteristic: type: return null error and value
我正在尝试将音频文件发送到PHP服务器.这是Objective-C代码:
NSData *data = [NSData dataWithContentsOfFile:filePath];
NSLog(@"File Size: %i",[data length]);
//set up request
NSMutableURLRequest *request= [[NSMutableURLRequest alloc] init];
[request setURL:[NSURL URLWithString:urlString]];
[request setHTTPMethod:@"POST"];
//required xtra info
NSString *boundary = @"---------------------------14737809831466499882746641449";
NSString *contentType = [NSString stringWithFormat:@"multipart/form-data; boundary=%@", boundary];
[request addValue:contentType forHTTPHeaderField: @"Content-Type"];
//body of the post
NSMutableData *postbody = [NSMutableData data];
[postbody appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[postbody appendData:[[NSString stringWithFormat:@"Content-Disposition: form-data; name=\"thefile\"; filename=\"recording\"\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[postbody appendData:[[NSString stringWithString:@"Content-Type: application/octet-stream\r\n"] dataUsingEncoding:NSUTF8StringEncoding]];
[postbody appendData:data];
[postbody appendData:[[NSString stringWithFormat:@"\r\n--%@--\r\n", boundary] dataUsingEncoding:NSUTF8StringEncoding]];
[request setHTTPBody:postbody];
apiConnection = [[NSURLConnection alloc] …Run Code Online (Sandbox Code Playgroud)