2013年8月23日
摘要: 用alloc,new,copy和mutableCopy创建的对象必须自己释放,其他对象都可以当成是引用计数为1且位于自动回收池中。1. NSString *second= [[NSString alloc] init]; //second的引用计数为1 [someStringArray addObject: second]; //2 。被插入数组中,数组回自动持有加入其中对象。//需要一次release2. NSString *sixth= [NSString stringWithString:@"Toughie"]; //1 NSArray *anotherArray = 阅读全文
posted @ 2013-08-23 15:26 (@_@)~ 阅读(116) 评论(0) 推荐(0) 编辑
摘要: 一个方法声明:-(NSInteger) pickerView:(UIPickerView *)pickerView numberOfRowsInComponent:返回类型 方法名称 第一个参数类型 本地参数名称 第二个参数公开名称(NSInteger) component第二个参数类型 第二个参数的本地名称将上面的消息发送给接收者:[pickerDelegate pickerView:somePicker numberOfRowsInComponent:component]; 接收者 消息名称 值 第二个参数名称 第二个参数值在objective-c中可以为参数... 阅读全文
posted @ 2013-08-23 15:21 (@_@)~ 阅读(180) 评论(0) 推荐(0) 编辑
摘要: 需要实例化UIActivityViewController这个类,通过initWithActivityItems:applicationActivities: 方法:initWithActivityItems:要分享的东西,可以是NSString, UIImage, 自己定义的符合UIActivityItemSource 协议的类的实例。applicationActivities:代表这项分享的动作你自动的应用可以支持将用户输入的文字发送到UIActivityViewController类的实例化头文件#import @interface ViewController : UIViewCont 阅读全文
posted @ 2013-08-23 15:13 (@_@)~ 阅读(281) 评论(0) 推荐(0) 编辑
  2013年8月20日
摘要: @implementation ViewController//call this method when user select a different one- (void) segmentChanged: (UISegmentedControl *) paramSender { if ([paramSender isEqual:self.mySegmentedControl]) { NSInteger selectedSegmentIndex = [paramSender selectedSegmentIndex]; NSString *selectedSegmentTe... 阅读全文
posted @ 2013-08-20 12:16 (@_@)~ 阅读(223) 评论(0) 推荐(0) 编辑
  2013年8月18日
摘要: @implementation ViewController- (UIImage *) minimumTrackImage{ // thumb左侧样式 UIImage *result = [UIImage imageNamed:@"MinimumTrack"]; UIEdgeInsets edgeInsets; edgeInsets.left = 4.0f; edgeInsets.top = 0.0f; edgeInsets.right = 0.0f; edgeInsets.bottom = 0.0f; result = [result resizableIm... 阅读全文
posted @ 2013-08-18 18:56 (@_@)~ 阅读(223) 评论(0) 推荐(0) 编辑
  2013年7月22日
摘要: 有多个project很方便,但是不同project之间不能共享资源,可以这样使其共享。最简单的方法是,add filetarget sources links without copy them 1.将要共享的资源加入workspace,直接讲文件拖入,同时确保Destination Copy items……不勾选 2. 将目标文件拖入要使用者,发现不让我托入:选中使用者--targets--Build Phases--+,从本地加入目标文件,一样确保Destination Copy items……不勾选这样目标文件就进到使用者的workspace中3.在使用者中import目标文件,发现.. 阅读全文
posted @ 2013-07-22 16:39 (@_@)~ 阅读(210) 评论(0) 推荐(0) 编辑
摘要: 1.重用别人代码前先复制一份,在Xcode中打开后先Product--Clean下2.option+command+0: 控制右侧utilities开关cmd+0: 控制左侧导航option+cmd+enter: 显示双列,show the assistant editorcmd + enter: 单列 show the standard editorcmd + option + shift +enter: 第三个eiditor, show the version editor,对比修改前后的代码cmd + shift + 上下键:在对应的.m和.h文件中来回转换cmd + 上下左右键: 将光 阅读全文
posted @ 2013-07-22 12:27 (@_@)~ 阅读(263) 评论(0) 推荐(0) 编辑