我有3个数据图,通过他们的绘画事件绘制.当我有需要插入图表的数据时,我调用controls invalidate()命令.
第一个控件的paint事件实际上为其他2个图形创建了一个位图缓冲区,以避免重复长循环.
因此,invalidate命令按特定顺序(1,2,3).这很有效,但是当绘制的数据到达图形窗口(PictureBox)的末尾时,数据通常会开始滚动,绘制事件开始以错误的顺序触发(2,3,1).
以前有人遇到过这个吗?为什么会发生这种情况?
参考下面的代码,我发现isKindOfClass无法识别类.
id parent = [self.tableDataSource objectAtIndex:indexPath.row];
//parent Can be either 'document' or 'folder'
NSLog(@"'%@'='%@' ?",[parent class],[Document class]);
BOOL classCheck = [[parent class] isKindOfClass:[Document class]];
NSLog (@"%@", classCheck? @"Yes!" : @"No!");
Run Code Online (Sandbox Code Playgroud)
控制台日志:
2011-01-20 10:44:29.746 ApplicationName [906:307]'文件'='文件'?
2011-01-20 10:44:29.756 ApplicationName [906:307]不!
以前有人遇到过这个吗?
"annot"CGPDFDictionary"Rect"如何转换为objective c Rect:
我有一个包含对象集合的Queue,其中一个对象是一个名为GlobalMarker的类,它有一个名为GlobalIndex的成员.
我想要做的是找到GlobalIndex包含给定值的队列的索引(这将始终是唯一的).
只需使用Contains下面显示的方法返回一个bool.如何获取此匹配的队列索引?
RealTimeBuffer
.OfType<GlobalMarker>()
.Select(o => o.GlobalIndex)
.Contains(INT_VALUE);
Run Code Online (Sandbox Code Playgroud) 我正在将GetCurrentDate()指针传递给tm结构.在该函数中,我打印未初始化的数据,然后初始化.预期成绩.
但是当我返回时,tm结构显示为未初始化.请参阅下面的控制台输 我究竟做错了什么?
未初始日期:??? ??? - 1073908332 01:9448278:-1073908376 -1217355836
初始日期:2010年5月5日星期三23:08:40
来电日期:??? ??? - 1073908332 01:9448278:-1073908376 -121735583
int main()
{
test();
}
int test()
{
struct tm* CurrentDate;
GetCurrentDate(CurrentDate);
printf("Caller date:%s\n",asctime (CurrentDate));
return 1;
}
int GetCurrentDate(struct tm* p_ReturnDate)
{
printf("uninitialized date:%s\n",asctime (p_ReturnDate));
time_t m_TimeEntity;
m_TimeEntity = time(NULL); //setting current time into a time_t struct
p_ReturnDate = localtime(&m_TimeEntity); //converting time_t to tm struct
printf("initialized date:%s\n",asctime (p_ReturnDate));
return 1;
}
Run Code Online (Sandbox Code Playgroud) c# ×2
cocoa-touch ×2
ios ×2
ipad ×2
iphone ×2
c ×1
drawing ×1
invalidation ×1
objective-c ×1
onpaint ×1
pdf ×1
pointers ×1
queue ×1
time ×1