随笔分类 -  CocoaTouch

上一页 1 2

Unsupported configuration plain style unsupported in a navigation item
摘要:在IB上,如果你在bar button Item上添加了Round Rect Button 可能会出现这个错误,这是需要将 BarbuttonItem设置成:Bordered 阅读全文

posted @ 2013-01-07 13:32 小浪鼓 阅读(2304) 评论(2) 推荐(0)

dyld:Library not loaded
摘要:dyld:Library not loaded:/System/Library/Frameworks/AdSupport.framework/AdSupportReferenced from:/var/mobile/Applications/8E09C9AA-CA81-4C26-AEED-B2C632B60A54/Gridlocked.app/GridlockedReason: image not found这个bug主要是添加了 AdSupport.framework, 添加 Accounts.framework 和 Social.framework 的时候也会出现类似的错误,当然在6.0的 阅读全文

posted @ 2013-01-05 22:55 小浪鼓 阅读(1998) 评论(0) 推荐(0)

Rails 基本路由
摘要:转自:http://caterpillar.onlyfun.net/Gossip/Rails/Routing.htmlconfig/routes.rb中的設定,決定了請求會由哪個控制器的動作處理,這邊要先來介紹Rails中典型路由(Regular route)與命令路由(Named route)設定的方式(注意,routes.rb中越前頭的設定會先套用)。你可以設定整個應用程式的首頁,例如若想要在連結http://localhost:3000時,等同於連結http://localhost:3000/messages/index,可以如下:root :to => 'messages 阅读全文

posted @ 2013-01-04 00:16 小浪鼓 阅读(418) 评论(0) 推荐(0)

转:IOS 关键字self,super,copy, retain, assign , readonly , readwrite, nonatomic、@synthesize、@property、@dyna
摘要:#synthesize关键字: 根据@property设置,自动生成成员变量相应的存取方法,从而可以使用点操作符来方便的存取该成员变量 。@implementation 关键字,表明类的实现 @end 结束self 关键字 :类似于java中的this,是隐藏参数,指向当前调用方法的类。super 关键字 :调用父类的方法。self = [super init] 这里不是判断self与[super init]是否相等,而是判断是否可以成功初始化。[super init]:父类初始化成功的话,通过=给self,这样self成为一个非空对象,整个来说即非false(非NO)。#import 告诉预 阅读全文

posted @ 2013-01-03 21:02 小浪鼓 阅读(172) 评论(0) 推荐(0)

JSONKIT : format specifies type 'unsigned long' but the argument has type 'nsuinteger' (aka 'unsigned int')
摘要:Direct access to objective-c's isa is deprecated in favor of object_setClass() and object_getClass()object->isa 替换为 object_getClass(object) 10处左右keyObject->isa 替换为 object_getClass(keyObject) 一处(id)keys[idx]->isa 替换为 object_getClass((id)keys[idx]) 一处format specifies type 'unsigned lo 阅读全文

posted @ 2012-12-18 14:46 小浪鼓 阅读(6320) 评论(0) 推荐(1)

FaceBook sdk FQL
摘要:单个查询:SELECT about_me,name,relationship_status,birthday_date,interests,sex,work,education FROM user WHERE uid = me()多个查询NSString *query =@"{"@"'other_info':'SELECT name,education,work FROM user where uid=780798254'," @"'my_info':'SELECT uid, name, 阅读全文

posted @ 2012-12-17 12:00 小浪鼓 阅读(536) 评论(0) 推荐(0)

IOS 实现滚动文字
摘要:当然最好应该使用block的方式,在此只是标记一下。 self.firstButton.backgroundColor = [UIColorgreenColor]; CGRect frame = self.firstButton.frame; frame.origin.x = 320; self.firstButton.frame = frame; [UIViewbeginAnimations:@"testAnimation"context:NULL]; [UIViewsetAnimationDuration:8.8f]; [UIViewsetAnimationCurve: 阅读全文

posted @ 2012-12-15 16:11 小浪鼓 阅读(8228) 评论(0) 推荐(0)

如果一个按钮被覆盖如何响应?
摘要:在他们的父类试图重写该函数//- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event {// // UIButton *firstButton = (UIButton *) [self viewWithTag:1];// CGPoint pointInB = [firstButton convertPoint:point fromView:self];// // if ([firstButton pointInside:pointInB withEvent:event])// return firstButto... 阅读全文

posted @ 2012-12-15 15:22 小浪鼓 阅读(450) 评论(0) 推荐(0)

IOS 难理解的几个屏幕接触问题
摘要:1. 首先,- (UIView *)hitTest:(CGPoint)point withEvent:(UIEvent *)event和pointInside:withEvent:函数是什么关系?2. 具体到某个例子,UITableView是UIScrollView的子类,那么我们点击一个UITableViewCell的时候,我们是准备上下移动table 还是说要select这个table呢?3. 如果一个UIScrollView覆盖住一个UIButton,那么我要调用点击那个UIButton 怎么办?对于第一个问题,hitTest:函数就是判断当前你的手指触摸是不是在当前视图中。如何判断呢? 阅读全文

posted @ 2012-12-11 00:33 小浪鼓 阅读(6846) 评论(0) 推荐(1)

-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:] ERROR
摘要:UITableViewCell *cell = (UITableViewCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UITableView dequeueReusableCellWithIdentifier:forIndexPath:]: unrecognized 阅读全文

posted @ 2012-12-02 23:31 小浪鼓 阅读(3864) 评论(4) 推荐(0)

XCode 在系统抛出异常处设置断点
摘要:有时候我们的程序不知道跑到哪个地方就 crash 了,而 crash 又很难重现。保守的做法是在系统抛出异常之前设置断点,具体来说是在objc_exception_throw处设置断点。设置步骤为:首先在 XCode 按 CMD + 6,进入断点管理窗口;然后点击右下方的 +,增加新的 Symbolic Breakpoint,在 Symbol 一栏输入:objc_exception_throw,然后点击 done,完成。 这样在 Debug 模式下,如果程序即将抛出异常,就能在抛出异常处中断了。比如在前面的代码中,我让 [firstObjctcrashTest]; 抛出异常。在 objc_ex 阅读全文

posted @ 2012-11-28 11:36 小浪鼓 阅读(326) 评论(0) 推荐(0)

带Gesture的UIView上的UIButton如何响应Action
摘要:如果你的UIView加上了Tap Gesture,同时这个UIView放上一个UIButton那么当你点击这个UIButton的时候,调用的是Gesture的Action,那么如何解决这个问题呢?很简单,就是判断如果Gesture是点击到按钮上的,那么就不响应,那么这时候直接就进入了UIButton的Action.- (BOOL)gestureRecognizer:(UIGestureRecognizer *)gestureRecognizer shouldReceiveTouch:(UITouch *)touch { // Disallow recognition of tap gest.. 阅读全文

posted @ 2012-11-12 22:29 小浪鼓 阅读(1107) 评论(0) 推荐(0)

图片不同格式的区别
摘要:BMP: 点位图格式这个格式保存的图像没有失真,它保存每个像素的信息不支持文件压缩。 网页中较少使用。JPEG: 与平台无关,支持最高级别的压缩。压缩比越大,文件越小,图片质量越差。GIF:以8~256色存储图片数据。支持透明度,压缩,交错和多图像图片(动画)。不支持半透明,因为透明度不是alpha通道透明度。git颜色数量少,很多情况下文件远远小于JPEG。PNG:可以热河颜色深度存储图片,与平台无关。png也支持透明度以及压缩。分为PNG-8, PNG-24格式。IE对png支持不是很好网页不常使用。 阅读全文

posted @ 2012-10-22 11:15 小浪鼓 阅读(435) 评论(0) 推荐(0)

矩形的UISearchBar
摘要:for (UIView *searchBarSubview in [self.searchBar subviews]) { if ([searchBarSubview conformsToProtocol:@protocol(UITextInputTraits)]) { @try { [(UITextField *)searchBarSubview setBorderStyle:UITextBorderStyleRoundedRect]; } @catch (NSException *... 阅读全文

posted @ 2012-10-17 10:02 小浪鼓 阅读(245) 评论(0) 推荐(0)

UIView 超出边界的处理
摘要:例如:一个UIButton的一部分添加到一个UIView上,那么你点击的时候只有点击在和它父类交集的地方才起作用,如何解决这个问题呢?- (BOOL)pointInside:(CGPoint)point withEvent:(UIEvent *)event { if (CGRectContainsPoint(self.button.frame, point)) { return YES; } return [super pointInside:point withEvent:event];}很简单的,也就是你点击的点被包含在这个btton的frame里面,ret... 阅读全文

posted @ 2012-10-16 13:19 小浪鼓 阅读(1535) 评论(0) 推荐(0)

Xcode 4.5 生成Ad Hoc Profile
摘要:Add Ad Hoc configuration by duplicating release (You can do that by pressing + sign))You need to add distribution signing profile for Ad Hoc as well asRelease.Now on top left corner of your XCode screen. Click on project Name like here I click on MIMChartLIbI get popup like this.Click on Edit Scheme 阅读全文

posted @ 2012-10-04 12:18 小浪鼓 阅读(1015) 评论(0) 推荐(0)

Mac OS 删除 LaunchPad中的应用
摘要:1) Option 点击 删除 (仅对AppStore)2)sqlite3 ~/Library/Application\ Support/Dock/*.db "DELETE from apps WHERE title='APPNAME';" && killall Dock 阅读全文

posted @ 2012-09-27 16:40 小浪鼓 阅读(847) 评论(0) 推荐(0)

file is universal (3 slices) but does not contain a(n) armv7s slice error for static libraries on iOS
摘要:看具体毛病居然是我调用的第三方库的问题,吓我一大跳,解决:设置Target -> Bulid Setting"Build Active Architecture Only" to "Yes"参考 阅读全文

posted @ 2012-09-26 16:21 小浪鼓 阅读(736) 评论(0) 推荐(0)

修改UISearchDisplayController 的Search Bar上“Cancel”按钮的文字
摘要:- (void) searchDisplayControllerWillBeginSearch:(UISearchDisplayController *)controller{ [searchBar setShowsCancelButton:YES]; for (UIView *v in searchBar.subviews) { if ([v isKindOfClass:[UIButton class]]) { [(UIButton *)v setTitle:@"返回" forState:UIControlStateNormal]; ... 阅读全文

posted @ 2012-07-26 16:32 小浪鼓 阅读(2424) 评论(0) 推荐(0)

IOS应用发布NSLog的如何注释
摘要:1 选择工程的Target -> Build Settings -> Preprocessor Macros.如图,默认 Debug项,是“DEBUG=1”.2 在程序中设置全局宏定义在程序的 ApplicationName-Prefix.pch 文件中,加入如下,很简单#ifdef DEBUG#define DLog( s, ... ) NSLog( @"<%p %@:(%d)> %@", self, [[NSString stringWithUTF8String:__FILE__] lastPathComponent], __LINE__, [N 阅读全文

posted @ 2012-07-25 17:21 小浪鼓 阅读(2503) 评论(0) 推荐(0)

上一页 1 2

导航