摘要: 一、始终隐藏状态栏如果在App中需要状态栏一直是隐藏着的,可以在<YOUR_APP>AppDelegate的application:didFinishLaunchingWithOptions:函数中进行设置,比如下面这段示意代码可以让状态栏以淡出的方式隐藏起来:- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { // Override point for customization after applicatio 阅读全文
posted @ 2012-04-12 22:08 FoxBabe 阅读(3163) 评论(2) 推荐(1) 编辑
摘要: 每隔段时间执行相应的操作://时间间隔,每隔5秒执行handleMaxShowTimer NSTimeInterval timeInterval =5.0 ; //定时器 NSTimer *showTimer = [NSTimer scheduledTimerWithTimeInterval:timeInterval target:self s... 阅读全文
posted @ 2012-04-12 21:46 FoxBabe 阅读(297) 评论(0) 推荐(0) 编辑
摘要: 一、UITableView的最基本使用实现协议UITableViewDelegate,UITableViewDataSource的下述方法://设置表的分区数- (NSInteger)numberOfSectionsInTableView:(UITableView *)aTableView { return 1; }//设置每个区的行数- (NSInteger)tableView:(UITableView *)aTableView numberOfRowsInSection:(NSInteger)section { return [UIFont familyNames].coun... 阅读全文
posted @ 2012-04-12 21:30 FoxBabe 阅读(793) 评论(3) 推荐(1) 编辑
摘要: 一、UILabel的多行显示问题1.N行完全自适应: UILabel *testLabel = [[UILabel alloc] initWithFrame:CGRectMake(10, 30, 100, 21)]; NSString *txt = @"dffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"; testLabel.numberOfLines = 0; ///相当于不限制行数 testLabel.text = txt; 阅读全文
posted @ 2012-04-12 21:12 FoxBabe 阅读(296) 评论(0) 推荐(0) 编辑
摘要: 参考来自:http://zhiwei.li/text/2011/07/iphone%E4%B8%8Aaes%E5%8A%A0%E5%AF%86%E7%9A%84%E5%AE%9E%E7%8E%B0/头文件 NSDataEncryption.h#import <UIKit/UIKit.h>@interface NSData (AES256)- (NSData *)AES256EncryptWithKey:(NSString *)key;//加密- (NSData *)AES256DecryptWithKey:(NSString *)key;//解密@end实现 NSDataEncry 阅读全文
posted @ 2012-04-12 21:02 FoxBabe 阅读(2145) 评论(0) 推荐(1) 编辑
摘要: 引入头文件:#import <CommonCrypto/CommonDigest.h>加密算法://TODO: md5 加密方法- (NSString*)md5Digest:(NSString *)str{ //32位MD5小写 const char *cStr = [str UTF8String]; unsigned char result[32]; CC_MD5( cStr, strlen(cStr), result ); return [NSString stringWithFormat: ... 阅读全文
posted @ 2012-04-12 16:07 FoxBabe 阅读(347) 评论(0) 推荐(0) 编辑
摘要: 首先实现UIScrollViewDelegate协议:#import <UIKit/UIKit.h>@interface Activity01ViewController : UIViewController<UIScrollViewDelegate>{ UIScrollView *myscrollview;}@property (nonatomic,retain) UIScrollView *myscrollview;@end实现协议的下列方法:#import <UIKit/UIKit.h>@interface Activity01ViewControll 阅读全文
posted @ 2012-04-12 02:51 FoxBabe 阅读(1477) 评论(0) 推荐(1) 编辑
摘要: 参考来自:http://www.cocoachina.com/iphonedev/sdk/2011/0525/2885.html下面是.h文件的代码//// EGORefreshTableHeaderView.h// Demo//// Created by Devin Doty on 10/14/09October14.// Copyright 2009 enormego. All rights reserved.//#import <UIKit/UIKit.h>#import <QuartzCore/QuartzCore.h>typedef enum{ EGOOPul 阅读全文
posted @ 2012-04-07 00:02 FoxBabe 阅读(794) 评论(0) 推荐(0) 编辑
摘要: 参考来自:http://www.cocoachina.com/iphonedev/toolthain/2011/1019/3387.html如何用Facebook graphic api上传视频:http://developers.facebook.com/blog/post/532/Keychain保存数据封装:https://github.com/carlbrown/PDKeychainBindingsController对焦功能的实现:http://www.clingmarks.com/?p=612自定义圆角Switch按件:https://github.com/domesticcats 阅读全文
posted @ 2012-04-06 23:30 FoxBabe 阅读(411) 评论(0) 推荐(1) 编辑
摘要: 参考来自:http://www.cocoachina.com/iphonedev/toolthain/2011/1109/3480.html扫描wifi信息:http://code.google.com/p/uwecaugmentedrealityproject/http://code.google.com/p/iphone-wireless/条形码扫描:http://zbar.sourceforge.net/iphone/sdkdoc/install.htmltcp/ip的通讯协议:http://code.google.com/p/cocoaasyncsocket/voip/sip:http 阅读全文
posted @ 2012-04-06 23:21 FoxBabe 阅读(287) 评论(0) 推荐(1) 编辑
摘要: MPMoviePlayerViewController是苹果提供的播放视频的控制器,可以直接从当前的控制器中推出即可。 NSBundle *bundle = [NSBundle mainBundle]; NSString *moviePath = [bundle pathForResource:@"Movie" ofType:@"m4v"]; NSURL *movieURL = [NSURL fileURLWithPath:moviePath]; MPMoviePlayerViewController *moviePlayerViewController 阅读全文
posted @ 2012-04-06 21:15 FoxBabe 阅读(871) 评论(0) 推荐(0) 编辑
摘要: 一种简单的图片切换效果,如下:通过滚动中间的图片或页面控制,都可以实现图片的切换。在xib中添加UIScrollView和UIPageControl,并设置为对应类的IBOutlet,#import <UIKit/UIKit.h>@interface HomePage : UIViewController<UIScrollViewDelegate>{ IBOutlet UILabel *message; IBOutlet UIScrollView *myScrollView; IBOutlet UIPageControl *myPageControl;}@propert 阅读全文
posted @ 2012-04-06 13:04 FoxBabe 阅读(16177) 评论(2) 推荐(1) 编辑
摘要: 在导航栏中加上分段控件是很常用的做法,效果如下:UISegmentedControl *segmentedControl=[[UISegmentedControl alloc] initWithFrame:CGRectMake(80.0f, 8.0f, 300.0f, 30.0f) ]; [segmentedControl insertSegmentWithTitle:@"最新上架" atIndex:0 animated:YES]; [segmentedControl insertSegmentWithTitle:@"热销商品" atIndex:1 an 阅读全文
posted @ 2012-04-06 12:57 FoxBabe 阅读(1465) 评论(0) 推荐(0) 编辑
摘要: 1、在新建的工程中应该包含Mainwindow.xib,关于在Xcode4.2及以上中添加MainWindow.xib,可以查看这里。2、在MainWindows中添加Tab Bar Controller;3、向Tab Bar Controller中添加Navigation Controller,MainWindows的截图如下: 阅读全文
posted @ 2012-04-06 12:53 FoxBabe 阅读(529) 评论(0) 推荐(0) 编辑
摘要: 参考来自:http://blog.csdn.net/muyu114/article/details/68964981、新建一个空的应用程序2、添加一个空的xib文件到这里工程的应该是下面这个样子的:3、改变File’s Owner的class为UIApplication4、从Library中添加一个Object,并设置其class为你对应的应用程序的类(这里是DemoAppDelegate)5、添加windows,并在程序中设置windows为IBOutletThe xAppDelegate.h should read something like this:@interface DemoAp 阅读全文
posted @ 2012-04-06 12:43 FoxBabe 阅读(756) 评论(0) 推荐(2) 编辑
摘要: 方法一右侧进入BaseInfoEdit*View = [[BaseInfoEditalloc]initWithNibName:@"BaseInfo"bundle:nil];[self.navigationControllerpushViewController:Viewanimated:YES];返回方法[self.navigationControllerpopViewControllerAnimated:YES];方法二下方进入OilRecordAdd*View = [[OilRecordAddalloc]initWithNibName:@"OilRecordD 阅读全文
posted @ 2012-04-02 12:12 FoxBabe 阅读(264) 评论(0) 推荐(0) 编辑
摘要: 属性通过所谓的访问器方法,即访问信息的方法,将类变量和方法公开给外部使用(getter ,setter)。使用属性比使用手动构建的方法更有优势,包括点表示法和内存管理。@interface Car : NSObject{ int year; //类变量 NSString *make; NSString *model; NSArray *colors;}这样只是申明了类的变量,不是类的属性。此时不能通过点表示法来访问,即car.make是错误的。将上面的类变量设置为属性:#import <Foundation/Foundation.h>@interface Car ... 阅读全文
posted @ 2012-03-23 09:37 FoxBabe 阅读(413) 评论(0) 推荐(0) 编辑
摘要: Objectice-C中使用NSLog来输出日志信息,在Objectice-C和C中字符串最大的区别就是"fox"与@"fox",C字符串是指向一个字节字符串的指针,而NSString字符串(以@开头)是对象。操作C字符串的方法是修改每个字节中保存的值。NSString字符串是不可变的,你不能访问每个字节并编辑他们。而且实际的字符串数据也并非保存在对象中。NSString *fox = @"fox";printf("Hello:%s\n",[fox UTF8String]);NSLog("Hello:%@ 阅读全文
posted @ 2012-03-23 09:13 FoxBabe 阅读(447) 评论(0) 推荐(0) 编辑
摘要: Objectice-C中所有Cocoa Touch类都派生来自NSObject类,及类层次结构树的根。详细类图如下: 阅读全文
posted @ 2012-03-23 08:58 FoxBabe 阅读(535) 评论(0) 推荐(0) 编辑
摘要: 在第一篇Car的方法中加入一个类方法:+ (NSString *) motto{ return(@"Ford Prefects are Mostly Harmless");}#import <UIKit/UIKit.h>#import "Car.h"//统一定义颜色和button风格#define COOKBOOK_PURPLE_COLOR [UIColor colorWithRed:0.20392f green:0.19607f blue:0.61176f alpha:1.0f]#define BARBUTTON(TITLE, SELECT 阅读全文
posted @ 2012-03-23 08:44 FoxBabe 阅读(268) 评论(0) 推荐(0) 编辑