错误原因:
exc_bad_access(code=1, address=0x789870)野指针错误,主要的原因是,当某个对象被完全释放,也就是retainCount,引用计数为0后。再去通过该对象去调用其它的方法就会出现野指针错误。
例如:
Person *jerry = [[Person alloc]init]; // retainCount引用计数为1
[jerry eat];...
分类:
移动开发 时间:
2014-07-22 23:05:16
阅读次数:
372
1.我们使用最原始的方法去查找action,不同注解。
struts.xml文件先配置
news/addNewsInfo.jsp
news/editNewsInfo.jsp
news/newsInfo.jsp
action 默认执行的是NewsInfoAction中的excute方法。 http://localhost:8080/test/newsInfoAction.h...
分类:
其他好文 时间:
2014-07-22 23:02:55
阅读次数:
244
[ 问题: ]
Given a string s consists of upper/lower-case alphabets and empty space characters ' ', return the length of last word in the string.
If the last word does not exist, return 0.
[...
分类:
其他好文 时间:
2014-07-22 23:01:35
阅读次数:
331
[ 问题: ]
Given a sorted array and a target value, return the index if the target is found. If not, return the index where it would be if it were
inserted in order. You may assume no duplicates in th...
分类:
其他好文 时间:
2014-07-22 23:01:15
阅读次数:
270
1. 让你的脚本再多打印一行
2、让你的脚本只打印一行...
分类:
编程语言 时间:
2014-05-01 08:38:53
阅读次数:
312
数学和数学计算
print 25+30/6 #25加上30除以6 和为39
print 100-25*3%4 #100减去25乘以3的积再除以4的余数,就是100-3=97
print 100%16 #100除以16的余数=4
print 1/4 #1除以4,然后因为是整数,所以四舍5入为0
print 1.0/4.0 ##1.0除以4.0,因为是浮点数,所以等于0.25
print 3+5...
分类:
编程语言 时间:
2014-05-01 08:22:53
阅读次数:
653
在ios注册远程通知获取设备令牌token的时候
//注册远程通知获取设备令牌toKen
[[UIApplication
sharedApplication] registerForRemoteNotificationTypes:(UIRemoteNotificationTypeBadge |
UIRemoteNotificationTypeSound | UIRemo...
分类:
其他好文 时间:
2014-04-30 22:45:40
阅读次数:
288
在ios6以后,ios系统改变了屏幕旋转的方法,如果要设置屏幕旋转的方法,需要在rootvc里面进行编写,例如
UIViewController *viewCtrl = [[UIViewController alloc] init];
UINavigationController *navCtrl = [[UINavigationController alloc] initWithRoot...
分类:
其他好文 时间:
2014-04-30 22:24:39
阅读次数:
254
最近在练习win8的一个小应用的时候,要求打开电脑上的文件以及保存文件到电脑上的功能。对于还属于菜鸟的我来说,着实有点无助呀。后来查了很多资料,才好不容易做好了,但是还是有很多不懂和做的不到位的地方。
还有就是较之之前微软的知识,那些filestream之类的在win8应用中没有作用了。win8好像新推出了storage这一类方法,stream流也几乎把io的方法淹没了,表示很头疼,知识更新是没...
示例代码将在注册表位置:HKEY_CURRENT_USER\Software\ 读写键值
bool LicenseManage::OpenRegKey(HKEY& hRetKey)
{
if (ERROR_SUCCESS == RegOpenKey(HKEY_CURRENT_USER,"Software", &hRetKey))
{
return true;
...
分类:
其他好文 时间:
2014-04-30 22:12:40
阅读次数:
195