今天在编写一个输入框中文字验证时,出现了以下的错误
JingDuTianXia(3422,0xa0c50540) malloc: *** error for object 0xb1e94: pointer being freed was not allocated
*** set a breakpoint in malloc_error_break to debug
Program received signal: “SIGABRT”.
后来追查结果才发现是其中一个属性在一个方法中进行了字符串的赋值
- (int) checkAndSaveIn {
self.loginName = @"";
self.phone = @"";
self.email = @"";
self.loginCode = @"";
self.secondLoginCode = @"";
而在dealloc方法中进行了内存释放
- (void)dealloc {
[self.loginName release];
[self.phone release];
[self.email release];
[self.loginCode release];
[self.secondLoginCode release];
[self.registerTableView release];
[super dealloc];
}
而0xb1e94刚好就是@“”的值,所以是对@“”调用了release方法才导致了这个错误
另外发现类中的属性,在未设置值时,为nil。而UITextField类的text属性,在没有输入时,值也是nil
text
The text displayed by the text field.
@property(nonatomic, copy) NSString *text
Discussion
This string is nil by default.
分享到:
相关推荐
Number of context that are allocated (and not freed).
简单易懂的实例全面讲解了 Feed4JUnit 对数据与代码分离的测试支持
This function is used to grab the root, and avoid it is freed when we access it. But it doesn t ensure that the tree is not dropped.
This often does not affect the program immediately, waiting until the corrupted memory is used later (in the case of overwrites) or gradually accumulating allocated but unused blocks. Thus, debugging...
已释放1 介绍 释放 软件架构 软件架构说明 安装教程 xxx xxx xxx 使用说明 ...使用Readme_XXX.md来支持不同的语言,例如Readme_en.md,Readme_zh.md ...全称是Gitee最有价值的开源项目,是综合评估出的优秀开源项目 ...
本文的目的是使新手可以根据此文章的步骤和方法,架设一台专业,高效,安全的FREEBSD出来,并且可以立即投入实际运用。
在企业应用系统领域,会面对不同系统之间的通信、集成与整合,尤其当面临异构系统时,这种分布式的调用与通信变得越发重要。其次,系统中一般会有很多对实时性要求不高的但是执行起来比较较耗时的地方,比如发送短信...
已释放1介绍释放软件架构软件架构说明安装教程xxx xxx xxx使用说明xxx xxx xxx参与贡献叉本仓库新建Feat_xxx分支提交代码新建Pull Request特技使用Readme_XXX.md来支持不同的语言,例如Readme_en.md,Readme_zh.md ...
Do not depend on the symbol being brought in transitively via headers not directly included. One exception is if Foo is used in myfile.cc, it's ok to #include (or forward-declare) Foo in myfile.h, ...
内存优化(FreeD_3.0.0.3)适用于newifi路由器小云3.0平台。提供多个档位自动清理内存,高效快速的清理垃圾,提升路由器运行速度。安全性和稳定性请自行测试。
Fixed not adding the 0-terminator to strings when the option was set to add it Fixed ultimap hotkeys Fixed ultimap2 filtering Changing pointers in the change address dialog won't set/override global ...
This was due to a problem where it would be freed automatically if there was a problem with the ArchiveStream when trying to open it as a zip file (possibly corrupt). Best practice is that ...
远程登录文件服务数据库单端口扫描多端口扫描 扫描 80 或 443 端口的 B 类子网扫描一系列端口 扫描 22 到 25 端口的 B 类子网快速扫描排除目标结
To reserve or commit memory and unintentionally not release it when it is no longer being used. A process can leak resources such as process memory, pool memory, user and GDI objects, handles, threads...
获释##aka 停车场 开车很有趣,停车不是。 尤其是随之而来的所有压力。 即使在找到停车位后,我们也必须为添加到停车计时器中的硬币数量... Freed 为您提供了这种信心,它拥有一群细心的用户,可以保护您的汽车并确保
I decided against using SortedDictionary for the pages as it was slower than a normal Dictionary and for the purpose of a key value store the sorted-ness was not need and could be handled in other ...
names being generated on some platforms. This could cause INSIST failures. (CVE 2014-0591) [RT #35120] Features Changes Add the ability to specify ndots to "nslookup". [RT #34711] Introduce a ...
1)..Important: Installation layout was changed. All packages now have version suffix (e.g. EurekaLogCore240.bpl). No files are copied to \bin folder of IDE. Run-time package (EurekaLogCore) is copied ...
The mbuf chain containing the packet will be freed. The mbuf opt, if present, will not be freed.