
iphone
iteye_9729
这个作者很懒,什么都没留下…
展开
专栏收录文章
- 默认排序
- 最新发布
- 最早发布
- 最多阅读
- 最少阅读
-
itunesconnect不能打开同意协议更新
https://developer.apple.com/membercenter/mcUpdateAgreement.action2012-06-20 14:59:30 · 309 阅读 · 0 评论 -
移出svn管理
[code="java"]find . -type d -name ".svn"|xargs rm -rf [/code]2011-11-23 16:33:14 · 137 阅读 · 0 评论 -
改变项目名
Xcode3.2:Project->Rename...Xcode4.2:View->Utilties->Show File Inspector2011-11-23 11:31:39 · 116 阅读 · 0 评论 -
Code Sign error: Provisioning profile XXXX can't be found
如果你更新了profile,再编译iphone项目,发现下面的错误,那你无论如何clean也不会成功,那真是让人恼火阿这时候,先copy上面那行出错信息,然后关闭这个项目,打finder到你的项目文件xxxx.xcodeproj上面按鼠标右键,选择Show Package Contents菜单,在新打开的finder的,找到project.pbxproj,使用一个文本edit打开它,用查找...原创 2011-11-23 11:12:37 · 98 阅读 · 0 评论 -
xcode4 svn配置
Xcode SVN配置 编辑 ~/.subversion/config 文件 注意:如果”.subversion”目录不存在,请运行”svn status”命令,虽然此命令会失败,但是会为你创建所需要的文件. vim ~/.subversion/config 打开文件 1. 找到 global-ignores 一行,去掉注释,编辑成 glob...2011-11-23 09:43:28 · 112 阅读 · 0 评论 -
iOS5键盘弹出view自适应
[code="java"][[NSNotificationCenter defaultCenter]addObserver:self selector:@selector(keyboardWillShow:) name:UIKeyboardWillShowNotification object:nil]; [[NSNotificationCenter defaultCenter]ad...2011-11-21 16:37:42 · 100 阅读 · 0 评论 -
NSFetchRequest排序
[code="java"]NSSortDescriptor *sortByPrice = [[NSSortDescriptor alloc] initWithKey:@"price" ascending:NO];[fetchRequest setSortDescriptors:[NSArray arrayWithObjects:sortByPrice, nil]][/code]2011-11-10 16:53:36 · 249 阅读 · 0 评论 -
系统删除照片动画
[code="c"] [UIView beginAnimations:nil context:NULL]; [UIView setAnimationTransition:103 forView:self.view cache:YES]; [UIView setAnimationDuration:0.5f]; [UIView setAn...2011-11-10 16:08:42 · 103 阅读 · 0 评论 -
iphone单元测试
一.添加测试Target:Add->New Target -> Cocoa Touch -> Unit Test Bundle 二.在Direct Dependencies点点加号,添加要测试的项目,然后关闭窗口 三.在项目中新创建一个Group,用以存放单元测试代码 四.新建测试类:Add -> New File -> Cocoa Touch...2011-11-09 12:21:50 · 90 阅读 · 0 评论 -
NSString 去首尾空格
[code="java"] NSString* str = @" hello world ! "; str = [str stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceCharacterSet]]; NSLog(@"[%@]", str);[/code]函数原型[co...2011-11-02 10:59:36 · 127 阅读 · 0 评论 -
UITextField密码框
[code="java"][txtPass setSecureTextEntry:YES];[/code]2011-10-31 18:23:18 · 124 阅读 · 0 评论 -
设置导航样式
[code="java"][UIApplication sharedApplication].statusBarStyle = UIStatusBarStyleBlackOpaque;[/code]可取值:[code="java"]typedef enum { UIStatusBarStyleDefault, UIStatusBarStyleBlackT...2011-10-31 15:57:50 · 133 阅读 · 0 评论 -
uitableview滚动到最后一行
[code="java"]- (void)scrollTableToFoot:(BOOL)animated { NSInteger s = [self.chatTable numberOfSections]; if (s2011-11-25 17:30:14 · 169 阅读 · 0 评论 -
動畫效果 -- 之淡出
[code="java"][UIView beginAnimations:nil context:self];[UIView setAnimationDelay:0.25f]; loadingView.alpha = 0.0f; [UIView commitAnimations];[/code]2011-05-16 11:32:53 · 93 阅读 · 0 评论 -
根据错误编号取得错误描述
[code="java"]NSError *error = [NSError errorWithDomain:NSOSStatusErrorDomain code:error_code userInfo:nil];NSLog(@"Error: %@", [error descript...原创 2012-05-17 14:54:48 · 161 阅读 · 0 评论 -
取设备信息
[code="java"]NSLog([[UIDevice currentDevice] name]); // Name of the phone as named by userNSLog([[UIDevice currentDevice] uniqueIdentifier]); // A GUID like stringNSLog([[UIDevice currentDevice]...原创 2012-03-30 14:11:08 · 110 阅读 · 0 评论 -
为CoreData添加版本管理
[code="java"]/** Returns the persistent store coordinator for the application. If the coordinator doesn't already exist, it is created and the application's store added to it. */- (NSPersist...2012-03-30 10:32:19 · 143 阅读 · 0 评论 -
Xcode4.3 控制台中文乱码
shift+command+<修改 Run project.app->Info->Debugger 为GDB2012-03-22 17:06:59 · 111 阅读 · 0 评论 -
删除more里面的Edit
删除 more 里面的 Edit[code="java"]self.tabBarController.customizableViewControllers = nil;[/code]customizableViewControllersThe subset of view controllers managed by this tab bar controller...2011-12-01 16:43:10 · 116 阅读 · 0 评论 -
svn 文件状态标记含义
A item文件、目录或是符号链item预定加入到版本库。 C item文件item发生冲突,在从服务器更新时与本地版本发生交迭,在你提交到版本库前,必须手工的解决冲突。 D item文件、目录或是符号链item预定从版本库中删除。 M item文件item的内容被修改了。 R item文件、目...原创 2011-11-30 09:31:25 · 96 阅读 · 0 评论 -
强引用与弱引用探讨
保留一个对象创建了一个对该对象的“强”引用。一个对象只有在它的所有强引用都被释放后才能被回收。因此,一个对象的生命周期取决于其强引用的所有者。在某些情况下,这种行为可能并不理想。您可能想要引用一个对象而不妨碍对象本身的回收。对于这种情况,您可以获取一个“弱”引用。弱引用是通过存储一个指向对象的指针创建的,而不是保留对象。 弱引用在可能会出现循环引用的情况下是必不可少的。例如,如果对象A和...原创 2012-03-16 10:51:27 · 227 阅读 · 0 评论 -
導航加入功能按鈕
[code="java"]UIBarButtonItem *takeGoods = [[[UIBarButtonItem alloc] init] autorelease];[takeGoods setAction:@selector(takeGoods:)];[takeGoods setTarget:self]; takeGoods.title = @"購買"; ...2011-05-17 13:44:19 · 96 阅读 · 0 评论 -
鍵盤隱藏
[code="java"][self.txtNameField resignFirstResponder];[/code]說明:常規做法是將VIEW最下層加入一個UIButton,將其類型設爲Custom(不會顯示邊框),然後綁定其ACTION事件,當該按鈕被點擊時,調用VIEW上所有INPUT的resignFirstResponder方法....2011-05-16 17:22:38 · 68 阅读 · 0 评论 -
UITableView高度自適應
[code="java"]- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath { // 列寬 CGFloat contentWidth = self.tableView.frame.size.width; // 用何種字體進行顯示 UIF...2011-05-16 17:05:43 · 57 阅读 · 0 评论 -
移出所有子VIEW
[code="java"][loadingView.subviews makeObjectsPerformSelector:@selector(removeFromSuperview)];[/code]原创 2011-05-16 11:38:03 · 74 阅读 · 0 评论 -
苛刻的单例
作为设计模式中最简单的一个,单例模式还是在很多系统中都会用到,总有那么一些实例,从始至终只需要它的一个实例,而且任何时候都要总方便的得到,像 Application 对象啦,环境对像啊。要保持你设计的类别人只会初始出一个实例来,像 Java/C++/C# 中的做法一般希望能保证以下那些:1. 构造方法藏起来,private 修饰,这样只能通过统一的工厂方法获得实例,因为 new 出...原创 2012-02-24 17:26:22 · 144 阅读 · 0 评论 -
添加Three20到项目中
省去一切关于Three20的介绍下载地址:https://github.com/facebook/three20一.解压压缩包,将src目录copy到工程中.二.命令行进入到src目录的script.三.执行命令导入库[code="java"]python ttmodule.py -p /your_project_path/project.xcodeproj...2012-02-22 14:33:04 · 100 阅读 · 0 评论 -
接近感应传感器使用
[code="java"][[UIDevice currentDevice] setProximityMonitoringEnabled:YES];[/code][code="java"]-(void)sensorStateChange:(NSNotificationCenter *)notification { if ([[UIDevice currentDevic...2012-02-16 14:22:22 · 463 阅读 · 0 评论 -
手势识别
注册:[code="java"] UISwipeGestureRecognizer *recognizer; recognizer = [[UISwipeGestureRecognizer alloc] initWithTarget:self action:@selector(handleSwipeFrom:)]; [recognizer setDirec...2011-09-01 13:43:49 · 150 阅读 · 0 评论 -
详解Objective-c Block应用
目前只有Mac 10.6 和iOS 4有支援。Block是由一堆可執行的程式組成,也可以稱做沒有名字的Function (Anonymous function)AD: 详解Objective-c block应用是本文要介绍的内容,主要介绍的是Objective-c block应用,不多说,先来看详细内容。Apple在C, Objective-C, C...原创 2011-12-20 13:52:25 · 85 阅读 · 0 评论 -
压缩图片
[code="c"]@interface UIImage (Compress)- (UIImage *)compressedImage;- (CGFloat)compressionQuality;- (NSData *)compressedData;- (NSData *)compressedData:(CGFloat)compressionQuality;...2011-08-22 14:38:25 · 100 阅读 · 0 评论 -
给自己的应用程序添加系统偏好设置二
Root.plist[code="java"] StringsTable Root PreferenceSpecifiers Type PSGroupSpecifier Title Group Type PSTextFieldSpecifier Title Name ...2011-08-18 15:22:21 · 173 阅读 · 0 评论 -
打开了优化选项后不打印log
.pch[code="java"]#ifndef __OPTIMIZE__#define NSLog(...) NSLog(__VA_ARGS__)#else#define NSLog(...) {}#endif[/code]2011-08-18 14:34:47 · 95 阅读 · 0 评论 -
uilabel字体适应宽度
[code="java"]textFieldCount.adjustsFontSizeToFitWidth = YES;textFieldCount.minimumFontSize = 1.0f;[/code]adjustsFontSizeToFitWidth:设置字体大小是否自动适应控件宽度minimumFontSize:设置最小字体,超过这个最小字体后,控件字体不会再变...2011-12-08 18:19:03 · 115 阅读 · 0 评论 -
给自己的应用程序添加系统偏好设置
在传统的桌面应用程序中,偏好设置是一些专门面向应用程序的设置,用于配置应用程序的行为和外观。iPhone OS也支持应用程序偏好设置,但并不将它作为应用程序整体的一部分。在iPhone OS上,应用程序级别的偏好设置并不由各个程序本身的定制界面来显示,而是由系统提供的Settings程序统一显示。为了将定制的应用程序偏好设置集成到Settings程序中,您必须在应用程序包的顶级...原创 2011-08-18 14:12:19 · 154 阅读 · 0 评论 -
嗯,就是内存方面的
[code="java"]UIScrollView* scroll = [[UIScrollView alloc] init]; NSLog(@"scroll retain count 1 is %d", [scroll retainCount]); ControlPanel* cp = [[ControlPanel alloc] init]; ...2011-08-18 09:59:56 · 86 阅读 · 0 评论 -
UITextField密码框
[code="java"][txtPass setSecureTextEntry:YES];[/code]2011-08-17 14:25:57 · 91 阅读 · 0 评论 -
mac环境变量
cdvim .profile加入行:export PATH=${PATH}:/usr/local/mysql/binsource .profile2011-08-10 09:31:11 · 81 阅读 · 0 评论 -
添加阴影和设置圆角
圆角:[code="java"] CALayer * layer = [theView layer]; [layer setMasksToBounds:YES]; [layer setCornerRadius:theRadius]; [layer setBorderWidth:theBorderWidth]; [layer setBorderColor:theCo...2011-07-07 15:08:59 · 174 阅读 · 0 评论 -
ios录音
[code="java"]- (AVAudioRecorder*)audioRecorder { if (!audioRecorder) { NSString *path = [NSHomeDirectory() stringByAppendingString:@"/tmp"]; NSTimeInterval timeInterval = [[NS...2011-12-31 16:40:20 · 137 阅读 · 0 评论