05 2012 档案

摘要:目录树的主要部分有root(/)、/usr、/var、/home等等。下面是一个典型的linux目录结构如下: / 根目录 /bin 存放必要的命令 /boot 存放内核以及启动所需的文件等 /dev 存放设备文件 /etc 存放系统的配置文件 /home 用户文件的主目录,用户数据存放在其主目录中 /lib 存放必要的运行库 /mnt 存放临时的映射文件系统,我们常把软驱和光驱挂装在这里的floppy和cdrom子目录下。 /proc 存放存储进程和系统信息 /root 超级用户的主目录 /sbin 存放系统管理程序 /tmp 存放临时文件的目录 /usr 包含了一般不需要修改的应用程序,命 阅读全文
posted @ 2012-05-27 08:47 FoxBabe 阅读(1846) 评论(1) 推荐(0) 编辑
摘要://通过点击事件自动轮换隐藏和显示导航栏- (void)clickimage:(id)sender{ BOOL navBarState = [self.navigationController isNavigationBarHidden];//获取当前的导航栏是否隐藏 [self.navigationController setNavigationBarHidden:!navBarState animated:YES]; [self.navigationController setToolbarHidden:!navBarState animated:YES]; if ... 阅读全文
posted @ 2012-05-13 15:32 FoxBabe 阅读(778) 评论(0) 推荐(1) 编辑
摘要:在现在的ios sdk中,我们一般通过UIApplication的setStatusBarOrientation:来进行View的强制旋转(当然,还要配合- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation),但是,setStatusBarOrientation并不一定马上会执行shouldAutorotateToInterfaceOrientation进行界面旋转,这时,有个小技巧可以让界面马上旋转过来,那就是调用一下 UINavigationController 阅读全文
posted @ 2012-05-13 15:27 FoxBabe 阅读(351) 评论(0) 推荐(1) 编辑
摘要:#import <Foundation/Foundation.h>@interface Base64Code : NSObject+ (NSString * )encodeBase64:(NSString * )input;//加密+ (NSString * )decodeBase64:(NSString * )input;//解密@end #import "Base64Code.h"#import "GTMBase64.h"@implementation Base64Code//加密+ (NSString * )encodeBase64:( 阅读全文
posted @ 2012-05-13 15:16 FoxBabe 阅读(497) 评论(0) 推荐(1) 编辑
摘要://// Histogram.h// CGraph//// Created by Fox on 12-4-16.// Copyright 2012 __MyCompanyName__. All rights reserved.////绘制柱状图#import <UIKit/UIKit.h>#define kindex 4@interface Histogram : UIView { CGFloat colors[kindex][4];//每一个柱状图的颜色 CGRect rects[kindex];//每一个柱状图的大小形状 CGContextRef canvas; CGFloat 阅读全文
posted @ 2012-05-13 15:02 FoxBabe 阅读(416) 评论(0) 推荐(1) 编辑
摘要://// ViewController.m// RunLoopDemo//// Created by Fox on 12-5-13.// Copyright (c) 2012年 __MyCompanyName__. All rights reserved.//#import "ViewController.h"@interface ViewController ()@end@implementation ViewController- (void)viewDidLoad{ [super viewDidLoad]; //使用NSTimer创建定时器 NSTimeInt... 阅读全文
posted @ 2012-05-13 14:49 FoxBabe 阅读(482) 评论(0) 推荐(1) 编辑
摘要:创建线程有三种方法:一、通过[NSThread detachNewThreadSelector:@selector(addAction) toTarget:self withObject:nil]创建,无具体的返回对象,线程不受用户控制,控制权掌握在系统的手中;二、通过[[NSThread alloc] initWithTarget:self selector:@selector(addNumberTo:) object:maxNumber]创建,通过该方式创建的线程由用户自己管理;三、自定义线程,通过继承NSThread来实现。//// ViewController.m// Thread.. 阅读全文
posted @ 2012-05-13 14:46 FoxBabe 阅读(316) 评论(0) 推荐(1) 编辑
摘要:方法一:通过View的中心位置来移动-(BOOL)textFieldShouldReturn:(id)sender{ self.view.center=CGPointMake(160,207); [sender resignFirstResponder]; return YES;}- (BOOL)textFieldShouldBeginEditing:(id)sender{ UITextField *textField = (UITextField *)sender; if(textField.tag==1) { self.view.ce... 阅读全文
posted @ 2012-05-08 07:33 FoxBabe 阅读(526) 评论(0) 推荐(1) 编辑
摘要:UIImageView *imageview1 = [[UIImageView alloc] initWithFrame:CGRectMake(125, 50, 229, 229)]; [imageview1 setImage:[UIImage imageWithContentsOfFile:path]]; imageview1.userInteractionEnabled = YES; UITapGestureRecognizer *singleTap1 = [[UITapGestureRecognizer alloc] initWi... 阅读全文
posted @ 2012-05-05 06:45 FoxBabe 阅读(6892) 评论(0) 推荐(1) 编辑
摘要:UIView设置背景图片可以使用如下代码: self.view.backgroundColor = [[UIColor alloc] initWithPatternImage:[UIImage imageNamed:@"dula.png"]];但是,这段代码存在一个危险。alloc和init一个对象后,count就会加1,这时需要调用release方法来释放内存。设置UIView背景图片更为保险的方法是:self.view.backgroundColor = [UIColor colorWithPatternImage:[UIImage imageNamed:@" 阅读全文
posted @ 2012-05-04 23:14 FoxBabe 阅读(335) 评论(1) 推荐(1) 编辑
摘要:iPhone系统的字体数量有限,并且多数对中文没有效果,下面介绍两种解决办法方法1: 添加对应的字体(.ttf或.odf)到工程的resurce,使用cocos2d中的FontLabel库,FontLabel继承于UILabel,象UILabel一样使用就好了 fontName直接使用添加的资源名字即可方法2; 1,添加对应的字体(.ttf或.odf)到工程的resurce,例如simkai.ttf 2,在info.plist中添加一项 Fonts provided by application (item0对应的value为simkai.ttf,添加多个字体依次添加就可以了) 3,... 阅读全文
posted @ 2012-05-04 23:08 FoxBabe 阅读(630) 评论(1) 推荐(1) 编辑
摘要:将UIView的最初位置置为窗口之外,然后通过一个动画来实现UIView的飞入效果,固定好进入的位置。 [newvision setFrame:CGRectMake(-200,30,175,145)]; [UIView beginAnimations:nil context:nil]; [UIView setAnimationCurve:UIViewAnimationCurveEaseInOut]; [UIView setAnimationDuration:1]; //动画时长 [newvision setFrame:CGRectMake(5,30,175,14... 阅读全文
posted @ 2012-05-04 08:27 FoxBabe 阅读(560) 评论(0) 推荐(1) 编辑
摘要:用UIImage加载图像的方法很多,最常用的是下面三种:一、用imageNamed函数引用[UIImage imageNamed:ImageName];二、用NSData的方式加载NSString *filePath = [[NSBundle mainBundle] pathForResource:fileName ofType:extension]; NSData *image = [NSData dataWithContentsOfFile:filePath]; [UIImage imageWithData:image];三,使用[UIImage imageWithContentOfFil 阅读全文
posted @ 2012-05-04 08:20 FoxBabe 阅读(441) 评论(0) 推荐(1) 编辑
摘要:1、引入头文件#include <sys/sysctl.h>#include <mach/mach.h>2、检测函数//MARK: 可用内存- (double)availableMemory{ vm_statistics_data_t vmStats; mach_msg_type_number_t infoCount = HOST_VM_INFO_COUNT; kern_return_t kernReturn = host_statistics(mach_host_self(),HOST_VM_INFO,(host_info_t)&vmStats,&in 阅读全文
posted @ 2012-05-04 08:15 FoxBabe 阅读(652) 评论(3) 推荐(1) 编辑
摘要:iPhone程序发布的时候应该会用到下面这些图标,大小和用途如下:图片大小(px)文件名用途重要程度512X512iTunesArtworkiTunes商店上展示可以没有,推荐有57X57Icon.pngiPhone/iPod touch上的App Store以及Home界面这个必须要有114X114Icon@2x.pngiPhone 4(高分辨率)的Home 界面可以没有,推荐有72x72Icon-72.png兼容iPad的Home界面可以没有,推荐有29x29Icon-Small.pngSpotlight搜索以及设置界面可以没有,推荐有50x50Icon-Small-50.png兼容iPa 阅读全文
posted @ 2012-05-03 23:54 FoxBabe 阅读(4313) 评论(0) 推荐(1) 编辑

点击右上角即可分享
微信分享提示