随笔分类 - objective-c 基础知识
摘要:http://bj007.blog.51cto.com/1701577/634438
阅读全文
摘要:http://285746555.blog.51cto.com/2966432/658383
阅读全文
摘要:NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"yyyy-MM-dd HH:mm:ss"]; NSDate *date =[[[NSDate alloc]initWithTimeIntervalSince1970:[cobj.time doubleValue]]autorelease]; // NSLog(@"%@", date); NSString *strDate = [dateFormatter strin
阅读全文
摘要:float version = [[[UIDevice currentDevice] systemVersion] floatValue];
阅读全文
摘要:http://www.cocoachina.com/newbie/basic/2012/0425/4192.html
阅读全文
摘要:http://www.cocoachina.com/bbs/read.php?tid=108119
阅读全文
摘要:objective-c 遍历文件夹及判断文件类型//// main.m// FileSearchTest//// Created by Zhang Leonardo on 11-10-31.// Copyright (c) 2011年 __MyCompanyName__. All rights reserved.// To discuss via :www.renren.com/leonardozhang //#import <Foundation/Foundation.h>int main (int argc, const char * argv[]){ @autorelease
阅读全文
摘要:http://www.cocoachina.com/bbs/read.php?tid=69165&fpage=In-App Purchase例子http://code4app.com/ios/In-App-Purchase/4fc85be56803fa4a49000000
阅读全文
摘要:iPhone上实现Default.png动画iPhone上实现Default.png动画 原理: 添加一张和Default.png一样的图片,对这个图片进行动画,从而实现Default动画的渐变消失的效果。 操作: 在- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOpti*****:(NSDictionary *)launchOpti*****中添加如下代码: // Make this interesting. UIImageView *s...
阅读全文
摘要:http://cocoa.venj.me/blog/simulate-low-speed-network-connection-for-ios-apps/
阅读全文
摘要:http://cocoa.venj.me/blog/custom-fonts-in-ios-apps/好久没有更新这里了,今天开始慢慢恢复更新。好了,废话不多说,开始讲正题。今天的话题其实也很简单,那就是在iOS中使用自定义字体。虽然iOS自带的字体通常已经足够我们使用了,但是,对于某些特殊程序来说,比如,电子书程序,可能需要用到一些特殊的字体,或者需要用更好看的字 体来达到我们想要的显示效果。不过,iOS是不支持系统级安装新字体的。不过在iOS 3.x中,我们已经可以用一个很简单的方法来使用自定义字体了。我们来创建一个简单的iOS项目来做演示。在界面上拖入一个UITextView,在代码中创
阅读全文
摘要:http://blog.csdn.net/wanglang3081/article/details/7468480
阅读全文
摘要:str = [strstringByReplacingOccurrencesOfString:@"\n"withString:@""];str = [strstringByReplacingOccurrencesOfString:@"\r"withString:@""];
阅读全文
摘要:在头文件中引入framework加入#import <MessageUI/MessageUI.h> 到InAppEmailViewController.h显示 MFMailComposeViewController UIMFMailComposeViewController与其他view controller一样; 我们可以在InAppEmailViewController 使用presentModalViewController使其滑入屏幕。替换InAppEmailController.m中的buttonPressed方法:1234567- (IBAction)buttonPre
阅读全文
摘要:在Iphone上有两种读取图片数据的简单方法: UIImageJPEGRepresentation和UIImagePNGRepresentation. UIImageJPEGRepresentation函数需要两个参数:图片的引用和压缩系数.而UIImagePNGRepresentation只需要图片引用作为参数.通过在实际使用过程中,比较发现: UIImagePNGRepresentation(UIImage* image) 要比UIImageJPEGRepresentation(UIImage* image, 1.0) 返回的图片数据量大很多.譬如,同样是读取摄像头拍摄的同样景色的照片,
阅读全文
摘要:iPhone开发之消息通信机制NSNotificationCenter是本文要介绍的内容,主要是来学习消息通信机制NSNotificationCenter的学习。最近写程序需要用到这类,研究了下,现把成果和大家分享。NSNotificationCenter是专门供程序中不同类间的消息通信而设置的,使用起来极为方便,长话短说。设置通知,就是说要在什么地方(哪个类)接受通知,一般在初始化中做。[[NSNotificationCenterdefaultCenter]addObserver:selfselector:@selector(test:)name:@"test"objec
阅读全文
摘要:1,使用presentModalViewController可创建模式对话框,可用于视图之间的切换。如何关闭presentModalViewController弹出来得时模式窗口presentModalViewController弹出来得时模式窗口如果[A presentModalViewController:B animated:YES];那么触发关闭事件的一般是在 B里面。除非使用后台线程计时器关闭(不实用)B 里面可以 通过 [self dismissModalViewControllerAnimated:YES]; 实现还可以通过发 消息给A,通知A关闭B还可以通过委托实现
阅读全文
摘要:[self performSelector:@selector(testLog:andString2:andString3:) withObject:@"aaa" withObject:@"bbbb" withObject:@"ccccc"];
阅读全文
摘要:NSXMLParser解析xml格式的数据 用法如下:首先,NSXMLParser必须继续NSXMLParserDelegate协议@interface XMLHelper : NSObject <NSXMLParserDelegate>首先设置XML数据,并初始化NSXMLParser- (void)viewDidLoad {NSMutableString *Strxml=[NSMutableString stringWithString:@"<Body><xml1>11111111</xml1><xml2><xml
阅读全文
摘要:http://blog.csdn.net/likendsl/article/details/7417878
阅读全文

浙公网安备 33010602011771号