随笔分类 - 09 屠虫笔记
摘要:工程缺少响应的运行支持库,所以才会爆出“连接失败”的问题
阅读全文
摘要:用xcode4打开xcode3建立的工程,有时候,不能自动转换版本,就会显示no scheme.这个是由于XXX..xcodeproj包中xcuserdata文件夹中user.xcuserdatad文件夹名字的问题...user.xcuserdatad文件夹的名字,不是当前用户的名字,就会显示no scheme.只要手动更改(或者删除)后,重启xcode就可以。如果仍然显示为no scheme,那么请在检查一下是否删除干净。或者在xcode中点击“no scheme”,然后建立一个scheme 即可。
阅读全文
摘要:使用 UITabBar 时,我们长长会遇到这样的问题。问题:一个使用(或继承)了UITabBar的Aview,为其添加一个子画面Bview时,虽然Bview的尺寸已经占满了整个手机屏幕,但是,Bview的底部,仍然能够响应UITabBar的事件。解决:将 [Aview addSubView:Bview]; 改为[Aview.superview addSubView:Bview]; 或者Aview.superview.superview ,总之一定不要Bview 继承UITabBar即可。
阅读全文
摘要:童鞋们都知道Xcode会根据当前SDK在Run按钮旁边的选项栏中显示适合的Simulator供开发者选择,如下图:但是有时候则错误显示“My mac 64-bit” ,这个明显不是我们想要的,如下图:上面这种情况主要出现原因在于你打开了另外一个mac电脑copy过来的项目时或者其他原因造成出现,那么解决的方法这里Himi给出来:解决步骤:首先关闭你的Xcode,找到你出现解决此问题的项目目录下,然后此项目的***.xcodeproj 文件,然后右键选择“显示包内容”,如下图:一般情况下,包中有如下3个文件:1.project.pbxproj 2.project.xcworkspace 3.xc
阅读全文
摘要:Error Starting executable: error launching remote program failed to get the task for process 715这个问题的解决方案如下(本人使用的是Xcode4.3):1.Select File->New File->ios->resources->property List name the file "Entitlements.plist‘ -->Creat2.点击这个Entitlements.plist,在右侧的空白处右键选择Add Row 自己新建一个"Ca
阅读全文
摘要:iPhone真机调试报如下错误时,关掉Xcode,重新启动就可以了,注意是关掉Xcode,彻底关掉。Error launching remote program: No such file or directory一般是因为修改了 Bundle identifier 造成的。
阅读全文
摘要:一般的问题是这样的“bool _WebTryThreadLock(bool), 0xxxxxx: Tried to obtain the web lock from a thread other than the main thread or the web thread. This may be a result of calling to UIKit from a secondary thread. Crashing now...”原因: update ui in background thread.解决办法: update ui in main thread.
阅读全文
摘要:Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]今天做一个tableView遇到一个这么个问题。经过baidu google,终于找到正解。因为- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath这个函数的返回值是个null!!查stackoverflow 找到下面的解。CellIdentifier I bet your cellForR...
阅读全文
摘要:你的问题是:self.view.frame.size.height = 100f;这样写没法通过编译,编译器会报错"expression is not assignable"原因是,这句话里面的几个点有两种不同的含义。self.view.frame是Objective-C语法,是读取view属性的frame属性,在Objective-C中使用点来访问属性只是一种语法糖,所以self.view.frame这句话会被转换成:[[self view] frame]也就是说,实际上这是消息传递。而frame属性是一个CGRect结构,所以frame.size.height是C语言的
阅读全文
摘要:malloc: *** mmap(size=1431658496) failed (error code=12)*** error: can't allocate region*** set a breakpoint in malloc_error_break to debug*** Assertion failure in -[UISectionRowData refreshWithSection:tableView:tableViewRowData:], /SourceCache/UIKit_Sim/UIKit-1914.84/UITableViewRowData.m:377主要问
阅读全文
摘要:这是因为ios6中的xib有AutoLayout这个属性,默认为选中,然后运行在低于ios6.0的机器中,会崩溃,报*** Terminating app due to uncaught exception 'NSInvalidUnarchiveOperationException', reason: 'Could not instantiate class named NSLayoutConstraint'*** First throw call stack:这个异常。只需将AutoLayout设为不选中即可参考:http://blog.sina.com.cn
阅读全文
摘要:原帖:http://blog.csdn.net/startexcel/article/details/7211292xib 中, 没有对File's Owner 的Outlets view 进行绑定, 导致在父视图中插入子视图时出错, 在IB中拖拽Files' Owner到view, 添加绑定后, 运行成功!总结一下创建视图和绑定的步骤:1. 创建控制器. File->New File->Iphone OS->Cocoa Touch Class->UIViewController subclass;2. 创建xib. File->New File-
阅读全文
摘要://大全//读取数据库数据-(void)movethesqlitefile{NSString*sourcepath=[[NSBundlemainBundle]pathForResource:@"database"ofType:@"sqlite"];NSLog(@"===================================%@",sourcepath);NSFileManager*filemanager=[NSFileManagerdefaultManager]; NSString*documentsDirectory= [
阅读全文
摘要:问题描述:在ios4.3系统中运行程序,调用actionSheet时,应用程序闪退 原代码: [actionSheet showInView:[UIApplication sharedApplication].keyWindow]; //New 解决取消按钮不灵敏的问题 替换为如下代码即可: [actionSheetshowInView:self.view];
阅读全文
摘要:第一种情况这种问题一般就是变量申请了内存并初始化了,但没有使用此变量,接着将此变量又重新赋值。如下:NSString *imageString = [[NSString alloc] init]; imageString = @"HResout"; 第二种情况测出的问题提示是Incorrect decrement of the reference count of an object that is not owned at this point by the caller问题出现在这一行[self.tableViewinitWithFrame:self.view.boun
阅读全文
摘要:晚上提交app的时候总是报出icon的错误iPad: Icon.png: icon dimensions (0 x 0) don’t meet the size requirements. The icon file must be 72×72 pixels起初以为图片坏了, 后来才发现好像是 10.7.3 的系统bug修复方法:将Compress PNG Files 设置为 NO转自:http://www.lazyid.com/2012/02/04/ipad-icon-png-icon-dimensions-0-x-0-dont-meet-the-size-requirements
阅读全文
摘要:在iOS3.0之后的版本不再使用这样的语法,解决方法如下:将:cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; 修改为:cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 参考:http://forums.macrumors.com/archiv...
阅读全文
摘要:UIActionSheet *menu = [[UIActionSheet alloc] initWithTitle: @"是否保存信息?"//@"保存信息到草稿" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"不保存" otherButtonTitles:@"保存", nil]; 解决方法,即在头文件中加入:UIActionSheetDelegate代理...
阅读全文
摘要:UITableViewCell *tvCell = [[[UITableViewCellalloc]initWithFrame:CGRectZeroreuseIdentifier:cellIdetify]autorelease];'initWithFrame:reuseIdentifier:' is deprecated --上述为极不赞成的写法,建议改为如下写法:
阅读全文
摘要://此问题修复完成后,需要编译以下工程才能看到效果Property 'lMenuTimes' requires method 'lMenuTimes' to be defined - use @synthesize, @dynamic or provide a method implementation//当一个有返回值的方法,缺少返回值时,会报如下警告relessorder/MenuController.m: warning: Semantic Issue: Control may reach end of non-void function//不相容的指针I
阅读全文
浙公网安备 33010602011771号