5月笔记

来源:互联网 发布:网络诽谤罪的管辖 编辑:程序博客网 时间:2024/06/05 14:22



NSArray * varr = [selfsubviews];

for (int i =0; i < [varr count]; i++)

{

NSLog(@"*********** i = %d, tag = %d class = %@", i, [[varr objectAtIndex:i]tag],

  [[varrobjectAtIndex:i] class]);

}



//run the function after the delay time

 [selfperformSelector:@selector(func)withObject:nilafterDelay:0.2];



响应消息的原理:由消息中心类再监控到消息的时候去分别调用,其本质还是指针调用,和信号响应不一样

[[NSNotificationCenterdefaultCenter] addObserver:self 

selector:@selector(theFunc

name:a_name_NOTIFY

 object:nil];



{

m_date = [NSDate date];

}


{

 m_str = [NSString stringwithFormat: ];

}


is like 


{

char arr[9];

m_p = arr;

}


and that is wrong and dangerous 


当错误日志为 0x0099 没有**方法的时候

但是看起来这个类有这样的方法,这个时候,就需要考虑是不是这个指针已经被释放了,成了野指针,所以调方法会出错



<key>aStr</key>

<string>find %@ request</string>


[NSString stringwithFormat: @"", ]


[NSString stringwithFormat: aStr, ] 可以这样去设置组装格式



原创粉丝点击