iOS各种问题处理

本文转载至:http://www.cnblogs.com/ygm900/category/436923.html
推荐初学者前去学习。
 
 
摘要: 解决如下:即某文件夹下出现多重子目录,级数很多,删除多余的子文件夹即可。至于如何产生的,有人说是xcode升级导致,不过没有见证 。我的不属于这类情况的。(参见:http://macosx.com/forums/mac-os-x-system-mac-software/321289-error-code-8060-cant-access-files-were-once-there.html)阅读全文
posted @ 2013-09-12 09:27 ygm900 阅读(7) | 评论 (0) 编辑
 
摘要: 模拟器默认的配置种没有“小地球”,只能输入英文。加入中文方法如下:找到模拟器的Settings--->General-->Keyboard-->International KeyBoards-->Add New Keyboard-->Chinese Simplified(PinYin) 即我们一般用的简体中文拼音输入法,配置好后,再输入文字时,点击弹出键盘上的“小地球”就可以输入中文了。阅读全文
posted @ 2013-09-09 13:11 ygm900 阅读(26) | 评论 (0) 编辑
 
 
摘要: 解决方案:将项目的Debugger模式设置为 GDB 即可。(LLDB下不打印中文)第一步:第二步:阅读全文
posted @ 2013-07-18 11:44 ygm900 阅读(18) | 评论 (0) 编辑
 
摘要: 先确认证书是否正确再确认Bundle Indentifier 是否与证书匹配再确认Deployment Target 为:sdk从6.0改为4.3如果xcode还无法识别iphone, Xcode->window->Organizer->Devices查看测试机连接状态是否为绿色,如果无法连接,我记得有个use for development选项,点击就可以了; 当然所有的前提是你的设备的UDID已经添加到测试机里,或是为越狱机、Xcode必须已安装你的设备对应的编译环境转http://blog.sina.com.cn/s/blog_8aecea5f0101axhf.html阅读全文
posted @ 2013-07-15 18:01 ygm900 阅读(18) | 评论 (0) 编辑
 
摘要: 1、使用类目在我们的静态库中涉及到 类目 catagory的使用时,会崩溃;此时我们需要设置project的Info里面的Link Flag处,增加-all_load,这样会链接所以存在的symbol;这是我们常用的一种处理方法,除此之外我们还可以使用以下方法:若我们使用了类目"NSObject+SBJSON.h"我们在h,m文件分别增加以下声明@interface DummyClass_NSObject_SBJSON {}@end@implementation DummyClass_NSObject_SBJSON@end2、使用nib若封装静态库的时候我们使用了xib文件阅读全文
posted @ 2013-07-15 13:36 ygm900 阅读(27) | 评论 (0) 编辑
 
摘要: 1. warning: Semantic Issue: Writable atomic property 'number' cannot pair a synthesized setter/getter with a user definedsetter/getter 指示在AFItemView.m文件2.warning: Semantic Issue: Writable atomic property 'numberOfImages' cannot pair a synthesized setter/getter with a user definedsett阅读全文
posted @ 2013-07-10 16:15 ygm900 阅读(34) | 评论 (0) 编辑
 
摘要: Undefined symbols for architecturei386:“_OBJC_CLASS_$_XXX”,referenced from:objc-class-ref in XXXld: symbol(s) not found for architecture i386clang: error: linker command failed with exit code 1 (use -v to see invocation)如果真机调试就是 undefined symbols for architecture armv7错误!发生这种错误通常是project.pbxproj这个文件阅读全文
posted @ 2013-07-09 10:37 ygm900 阅读(547) | 评论 (0) 编辑
 
摘要: duplicate symbol _main in: /Users/mb467/Library/Developer/Xcode/DerivedData/barChartDemo-gevlnavnpanltbgqdweijouguhcx/Build/Intermediates/barChartDemo.build/Debug-iphoneos/barChartDemo.build/Objects-normal/armv7/main-CCADE8545E02147B.o /Users/mb467/Library/Developer/Xcode/DerivedData/barChartDemo-..阅读全文
posted @ 2013-07-08 21:33 ygm900 阅读(357) | 评论 (0) 编辑
 
摘要: MobileCoreServices.framework 丢失后,可通过如下方式找回:1、在同事机器上拷贝一个。路径:2、重装一个xcode实践:将xcode4.5下的文件拷到xcode4.3 可以正常使用。阅读全文
posted @ 2013-07-05 16:00 ygm900 阅读(14) | 评论 (0) 编辑
 
摘要: 如果使用Xcode 4.5来新建项目,默认是支持AutoLayout的,但是AutoLayout是iOS 6的新特性,如果在iOS 5的simulator上运行程序,会出现Could not instantiate class named NSLayoutConstraint问题。解决方法是打开storyboard文件,去掉AutoLayout的选择。rob mayoff的神图一目了然。转:http://procoder.cnblogs.com阅读全文
posted @ 2013-06-30 11:34 ygm900 阅读(12) | 评论 (0) 编辑
 
摘要: 工程缺少响应的运行支持库,所以才会爆出“连接失败”的问题阅读全文
posted @ 2013-06-27 13:26 ygm900 阅读(8) | 评论 (0) 编辑
 
摘要: 用xcode4打开xcode3建立的工程,有时候,不能自动转换版本,就会显示no scheme.这个是由于XXX..xcodeproj包中xcuserdata文件夹中user.xcuserdatad文件夹名字的问题...user.xcuserdatad文件夹的名字,不是当前用户的名字,就会显示no scheme.只要手动更改(或者删除)后,重启xcode就可以。如果仍然显示为no scheme,那么请在检查一下是否删除干净。或者在xcode中点击“no scheme”,然后建立一个scheme 即可。阅读全文
posted @ 2013-06-27 12:28 ygm900 阅读(8) | 评论 (0) 编辑
 
摘要: 使用 UITabBar 时,我们长长会遇到这样的问题。问题:一个使用(或继承)了UITabBar的Aview,为其添加一个子画面Bview时,虽然Bview的尺寸已经占满了整个手机屏幕,但是,Bview的底部,仍然能够响应UITabBar的事件。解决:将 [Aview addSubView:Bview]; 改为[Aview.superview addSubView:Bview]; 或者Aview.superview.superview ,总之一定不要Bview 继承UITabBar即可。阅读全文
posted @ 2013-06-26 11:06 ygm900 阅读(10) | 评论 (0) 编辑
 
摘要: 童鞋们都知道Xcode会根据当前SDK在Run按钮旁边的选项栏中显示适合的Simulator供开发者选择,如下图:但是有时候则错误显示“My mac 64-bit” ,这个明显不是我们想要的,如下图:上面这种情况主要出现原因在于你打开了另外一个mac电脑copy过来的项目时或者其他原因造成出现,那么解决的方法这里Himi给出来:解决步骤:首先关闭你的Xcode,找到你出现解决此问题的项目目录下,然后此项目的***.xcodeproj 文件,然后右键选择“显示包内容”,如下图:一般情况下,包中有如下3个文件:1.project.pbxproj 2.project.xcworkspace 3.xc阅读全文
posted @ 2013-06-23 15:46 ygm900 阅读(12) | 评论 (0) 编辑
 
摘要: 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阅读全文
posted @ 2013-06-21 11:38 ygm900 阅读(22) | 评论 (0) 编辑
 
摘要: iPhone真机调试报如下错误时,关掉Xcode,重新启动就可以了,注意是关掉Xcode,彻底关掉。Error launching remote program: No such file or directory一般是因为修改了 Bundle identifier 造成的。阅读全文
posted @ 2013-06-21 11:38 ygm900 阅读(9) | 评论 (0) 编辑
 
摘要: 一般的问题是这样的“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.阅读全文
posted @ 2013-06-20 22:11 ygm900 阅读(19) | 评论 (0) 编辑
 
摘要: Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]今天做一个tableView遇到一个这么个问题。经过baidu google,终于找到正解。因为- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath这个函数的返回值是个null!!查stackoverflow 找到下面的解。CellIdentifier I bet your cellForR...阅读全文
posted @ 2013-06-13 18:08 ygm900 阅读(604) | 评论 (0) 编辑
 
摘要: 你的问题是: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语言的阅读全文
posted @ 2013-05-28 18:33 ygm900 阅读(97) | 评论 (0) 编辑
 
摘要: 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主要问阅读全文
posted @ 2013-05-27 13:33 ygm900 阅读(115) | 评论 (0) 编辑
 
摘要: 这是因为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阅读全文
posted @ 2013-05-26 00:17 ygm900 阅读(27) | 评论 (0) 编辑
 
摘要: 原帖: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-阅读全文
posted @ 2013-05-24 17:37 ygm900 阅读(46) | 评论 (0) 编辑
 
摘要: //大全//读取数据库数据-(void)movethesqlitefile{NSString*sourcepath=[[NSBundlemainBundle]pathForResource:@"database"ofType:@"sqlite"];NSLog(@"===================================%@",sourcepath);NSFileManager*filemanager=[NSFileManagerdefaultManager]; NSString*documentsDirectory= [阅读全文
posted @ 2013-05-24 10:41 ygm900 阅读(176) | 评论 (0) 编辑
 
摘要: 问题描述:在ios4.3系统中运行程序,调用actionSheet时,应用程序闪退 原代码: [actionSheet showInView:[UIApplication sharedApplication].keyWindow]; //New 解决取消按钮不灵敏的问题 替换为如下代码即可: [actionSheetshowInView:self.view];阅读全文
posted @ 2013-03-12 13:31 ygm900 阅读(10) | 评论 (0) 编辑
 
摘要: 第一种情况这种问题一般就是变量申请了内存并初始化了,但没有使用此变量,接着将此变量又重新赋值。如下: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阅读全文
posted @ 2013-02-04 15:19 ygm900 阅读(290) | 评论 (0) 编辑
 
摘要: 晚上提交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阅读全文
posted @ 2013-01-28 22:34 ygm900 阅读(70) | 评论 (0) 编辑
 
摘要: 在iOS3.0之后的版本不再使用这样的语法,解决方法如下:将:cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease]; 修改为:cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease]; 参考:http://forums.macrumors.com/archiv...阅读全文
posted @ 2013-01-28 19:06 ygm900 阅读(24) | 评论 (0) 编辑
 
摘要: UIActionSheet *menu = [[UIActionSheet alloc] initWithTitle: @"是否保存信息?"//@"保存信息到草稿" delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:@"不保存" otherButtonTitles:@"保存", nil]; 解决方法,即在头文件中加入:UIActionSheetDelegate代理...阅读全文
posted @ 2013-01-28 17:48 ygm900 阅读(25) | 评论 (0) 编辑
 
摘要: UITableViewCell *tvCell = [[[UITableViewCellalloc]initWithFrame:CGRectZeroreuseIdentifier:cellIdetify]autorelease];'initWithFrame:reuseIdentifier:' is deprecated --上述为极不赞成的写法,建议改为如下写法:阅读全文
posted @ 2013-01-28 16:40 ygm900 阅读(8) | 评论 (0) 编辑
 
摘要: //此问题修复完成后,需要编译以下工程才能看到效果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阅读全文
posted @ 2013-01-28 16:37 ygm900 阅读(183) | 评论 (0) 编辑
 
摘要: Incorrect NSStringEncoding value 0x0000 detected. 的意思是某个NSString型的变量,被赋为了空值。原因如下:1)本地终端未联网2)后台服务器挂掉总之,前台终端向后台请求数据时,没有请求到任何数据。阅读全文
posted @ 2013-01-26 14:10 ygm900 阅读(61) | 评论 (0) 编辑
 
摘要: Local declaration of 'content' hides instance variable一般是函数里面定义的变量和class属性变量重名了阅读全文
posted @ 2013-01-26 12:24 ygm900 阅读(19) | 评论 (0) 编辑
 
摘要: 当一个字符串为null时,它不能被正常地使用,否则会报如下错误Incorrect NSStringEncoding value 0x0000 detected. Assuming NSASCIIStringEncoding. Will stop this compatiblity mapping behavior in the near future错误案例:当nstrPublicUrl==null时,如果我们写下如下代码,就会报如上警告。//错误的案例,nstrPublicUrl==nil时NSString *nstrUrl = [NSString stringWithFormat:@&qu阅读全文
posted @ 2013-01-23 23:06 ygm900 阅读(250) | 评论 (0) 编辑
 
摘要: (一)wait_fences: failed to receive reply: 10004003的原因:这个问题的实质应该是在非主线程中 直接修改 界面解决的方法:在后台或子线程做的操作,刷新UI的时候,一定要在主线程进行//可能的具体情况:1、需要实现UIAlertView的代理方法- (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)buttonIndex{}2、在viewDidLoad方法里面生成了多个Button,在点击button是,切换他们的selected状态,会出现这个问题//[i阅读全文
posted @ 2013-01-21 01:52 ygm900 阅读(22) | 评论 (0) 编辑
 
摘要: 错误的写法_checkinLocation.coordinate.longitude = 26.876812;_checkinLocation.coordinate.longitude = 100.22569199999998;正确的写法float latitude = 26.876812; float longitude = 100.22569199999998; //这里可以是任意的经纬度值 CLLocation *_checkinLocation= [[[CLLocation alloc] initWithLatitude:latitude longitude:longitude] au阅读全文
posted @ 2013-01-16 14:18 ygm900 阅读(7) | 评论 (0) 编辑
 
摘要: 解决EXC_BAD_ACCESS错误的一种方法--NSZombieEnabledhttp://blog.csdn.net/likendsl/article/details/7566305阅读全文
posted @ 2013-01-16 13:29 ygm900 阅读(12) | 评论 (0) 编辑
 
摘要: 错误提示如下:分析: You are using multiline case statement. Your statements must be enclosed in{and}. The problem is declaring variables inside cases of a switch. The compiler is upset about trying to figure out scope when only some of the code is executed. If you put brackets around the contents of the '阅读全文
posted @ 2012-12-12 13:53 ygm900 阅读(18) | 评论 (0) 编辑
 
摘要: 解析一个稍微大点的XML数据20万条数据左右吧。没想到在解析XML的某个节点中,为了方便查看数据的解析进度,打印了一句Log,结果导致解析过程越来越慢。原来用XCODE打开那20万条数据,都很费劲,在执行过程中,为每一条数据大一条Log,电脑直接累疯了!阅读全文
posted @ 2012-12-11 15:54 ygm900 阅读(8) | 评论 (0) 编辑
 
摘要: 今天一合作伙伴传过来两个很大的XML文件,在iOS 程序下执行xmlTextReaderTyper(reader)方法后,总是返回0.最终发现,原来那两个XML文件不是UTF-8编码格式。解决方案:在PC上,使用UE将XML文件另存为下,格式选择UTF-8即可。阅读全文
posted @ 2012-12-11 13:27 ygm900 阅读(13) | 评论 (0) 编辑
原文地址:https://www.cnblogs.com/Camier-myNiuer/p/3393518.html