
objective c
kingmari
这个作者很懒,什么都没留下…
展开
-
objective-c block 详解(转)
转自:http://www.j2megame.org/index.php/content/view/2625/165.html Block Apple 在C, Objective-C, C++加上Block這個延申用法。目前只有Mac 10.6 和iOS 4有支援。Block是由一堆可執行的程式組成,也可以稱做沒有名字的Function (Anonymous function)。如转载 2012-07-05 16:24:10 · 425 阅读 · 0 评论 -
使用sqlite时遇到的错误 read-only
在模拟器上运行没有问题; 在真机上报如下错误: Attempt to add read-only file at path file://localhost/var/mobile/Applications/A80208B7-36C8-4CD0-94D9-E3EC57BDA4D6/BookingMeals.app/ShopCar.sqlite read/write. Adding it read转载 2012-09-25 18:39:55 · 582 阅读 · 0 评论 -
判断是否包含汉字
UTF8编码:汉字占3个字节,英文字符占1个字节 NSString *text = @"i'm a 苹果。..."; int length = [text length]; for (int i=0; i { NSRange range = NSMakeRange(i, 1); NSString *subString = [text substringWithRange:ran转载 2012-10-10 15:49:04 · 549 阅读 · 0 评论 -
mac下的包管理软件(相当于linux下的apt-get)
homebrew ,macport原创 2012-09-17 14:33:51 · 682 阅读 · 0 评论 -
//为cell设背景色
UIView *backgrdView = [[UIViewalloc] initWithFrame:cell.frame]; backgrdView.backgroundColor =RGBCOLOR(244,148, 35); cell.backgroundView = backgrdView; 或者 - (void)tableView:原创 2012-09-16 20:43:05 · 416 阅读 · 0 评论 -
在iOS中获取AGSMapView的图片
http://www.giser.net/?p=1047 在iOS中有时候会需要截取mapview当前的显示内容,用来辅助描述你的地理位置,下面的代码为截图的方法: if (NULL != UIGraphicsBeginImageContextWithOptions) UIGraphicsBeginImageContextWithOptions(self.mapView.fram转载 2012-09-30 12:53:15 · 961 阅读 · 0 评论 -
ios文件分享
由于最近项目需要读取本地用户的视频..发现无法读取ios设备自带"视频"应用中的视频..很懊恼..4了很多种方法.连assetLibrary都用上了.还不能...国内根本没有..去国外找也没有.. 最后发现一些看书软件..办公软件有个文件共享功能..只能以后让用户自己添加到文件共享了... 不给力的apple..还发现苹果自身的软件在播放视频的时候,如果连续快进或后退..一会就应用就挂转载 2012-09-28 02:25:15 · 717 阅读 · 0 评论 -
keyWindow,[UIApplication sharedApplication]
[touch locationInView:[[UIApplication sharedApplication] keyWindow]] keyWindow The application's key window. (read-only) @property(nonatomic, readonly) UIWindow *keyWindow Di原创 2012-08-25 23:27:27 · 2885 阅读 · 0 评论 -
UITableView删除行的问题
删除数据源中的对应数据必须在输出行cell之前,不然会崩溃,报错 Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Invalid update: invalid number of rows in section 0. The number of rows原创 2012-08-25 00:13:40 · 3053 阅读 · 1 评论 -
tableview插入,删除,改变cell高度的动画用beginUpdates和endUpdates
Call this method if you want subsequent insertions, deletion, and selection operations (for example, cellForRowAtIndexPath: and indexPathsForVisibleRows) to be animated simultaneously. This group of转载 2012-08-23 09:51:30 · 2515 阅读 · 0 评论 -
xib文件生成view
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath { static NSString *CellIdentifier = @"ProductCatagoryCell"; ProductCatagoryCel原创 2012-08-22 23:31:00 · 740 阅读 · 0 评论 -
于出现僵尸信号SIGBAT或者EXC_BAD_ACCESS的解决方案
第一步:在Xcode的菜单栏选择“Product”,然后选择“Edit Scheme”; 第二步:在弹出的对话框中选择“Arguments”; 第三步:在“Environment Varibles”中添加“NSZombieEnabled”,值是“YES” 。 这样就大功告成了。 这时候,如果你的程序在运行过程中还出现SIGBAT原创 2012-08-14 10:15:26 · 439 阅读 · 0 评论 -
sudo supervisorctl restart jingxin
sudo supervisorctl restart jingxin原创 2012-07-27 18:21:20 · 396 阅读 · 0 评论 -
UIWebview回避缓存css,js
UIWebview缓存机制是针对html的,对于css,或者js文件,它就自动缓存了。 可以通过src = “a.js?v='动态数字' ”这种方式来欺骗浏览器,使它以为这是新的请求,而不调用缓存原创 2012-08-03 16:18:06 · 1693 阅读 · 1 评论 -
下的彩色终端(Terminal)
转自:http://www.coolcode.org/?action=show&id=344&page=1 我这里做第二步会导致每次终端启动时都报个错,说是TerminalColours这个插件没有被测试过,不能被加载。后来我把他删了就不报错了 ---------------------------------------------------------------------转载 2012-07-07 23:49:14 · 1373 阅读 · 0 评论 -
修改navigationItem.backBarButtonItem.title的值
转自:http://blog.sina.com.cn/s/blog_5fde608901012l5q.html 在iphone开发中,设置navigationController中返回按钮的标题,默认为前一个视图中标题的title(请注意,必须是前一个视图控制器!!!backBarButtonItem属性是对应于本视图控制器的下一级控制器的返回按钮,区别于leftBarButto转载 2012-07-06 16:22:23 · 1664 阅读 · 0 评论 -
UINavagationBar,UISearchBar,UIToolBar,UITabBar 自定义 Background Image
这里运用了 object-c里面的一个类别,大体意思就是在不知道苹果封装起来的API内容的情况下,在外部程序中覆盖其原来的函数。大体这个意思吧。 程序代码: 在程序的任何一个 .m文件 后面加上下面代码即可 记住 要在 @end 的后面加上; @implementation UINavigationBar (CustomImage2) - (void)drawRect:(CGR转载 2012-07-06 16:42:37 · 593 阅读 · 0 评论 -
fmdb文档
转自:https://github.com/ccgus/fmdb FMDB This is an Objective-C wrapper around SQLite: http://sqlite.org/ The FMDB Mailing List: http://groups.google.com/group/fmdb Read the SQLite FAQ:转载 2012-07-05 16:53:36 · 799 阅读 · 0 评论 -
iOS7新特色
导航栏背景色用barTintColor设置 using barTintColor instead of tintColor to tint a bar’s background.原创 2013-10-11 14:55:45 · 727 阅读 · 0 评论