Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/sql-server-2005/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ios4 核心打印CPTextStyle fontName只读_Ios4_Core Plot - Fatal编程技术网

Ios4 核心打印CPTextStyle fontName只读

Ios4 核心打印CPTextStyle fontName只读,ios4,core-plot,Ios4,Core Plot,我正在玩core plot,我想为axis title设置字体系列和大小,所以我所做的是: CPTextStyle *axisTitleTextStyle = [CPTextStyle textStyle]; axisTitleTextStyle.fontName = @"Helvetica Bold"; axisTitleTextStyle.fontSize = 14.0; 但是当我编译时,我得到了一个错误: error: object cannot be set - either read

我正在玩core plot,我想为axis title设置字体系列和大小,所以我所做的是:

CPTextStyle *axisTitleTextStyle = [CPTextStyle textStyle];
axisTitleTextStyle.fontName = @"Helvetica Bold";
axisTitleTextStyle.fontSize = 14.0;
但是当我编译时,我得到了一个错误:

error: object cannot be set - either readonly property or no setter found
如何设置字体

谢谢, Max

试试这个

CPTextStyle *axisTitleTextStyle = [[CPTextStyle alloc] init];
axisTitleTextStyle.fontName = @"Helvetica Bold";
axisTitleTextStyle.fontSize = 14.0;

self.graph.titleTextStyle = axisTitleTextStyle;
[axisTitleTextStyle release];

CPTextStyle
不久前更改过。它现在是不变的。有一个叫做
CPMutableTextStyle

的可变变体,谢谢我在谷歌上找到了它。谢谢你的回答。马克斯