Time of Update: 2018-12-05
方法一:通過View的中心位置來移動-(BOOL)textFieldShouldReturn:(id)sender{ self.view.center=CGPointMake(160,207); [sender resignFirstResponder]; return YES;}- (BOOL)textFieldShouldBeginEditing:(id)sender{ UITextField *textField = (UITextField
Time of Update: 2018-12-05
- (void)viewDidLoad { [super viewDidLoad]; UIImage *anImage = [UIImage imageNamed:@"apple.png"]; UIImageView *myImageView = [[UIImageView alloc] initWithImage:anImage]; [[self view] addSubview:myImageView];//scale our height and width by
Time of Update: 2018-12-05
前一篇簡單的介紹了iPhone應用程式間通訊,主要是通過在被調用應用的Info.plist中加入URL方案,在應用中通過openUrl來實現程式的調用。而應用程式間的資料傳遞則可以更具url來實現,例如我要在test應用中輸入一個參數,將其傳遞給URLSchemeDemo中。則可以按照下面方法實現: NSString *temp = [NSString stringWithFormat:@"URLSchemeDemoapp:message=%@",self.message.text];
Time of Update: 2018-12-05
protocol-協議,就是使用了這個協議後就要按照這個協議來辦事,協議要求實現的方法就一定要實現。 delegate-委託,顧名思義就是委託別人辦事,就是當一件事情發生後,自己不處理,讓別人來處理。當一個A view 裡麵包含了B view,b view需要修改a view介面,那麼這個時候就需要用到委託了。需要幾個步驟1,首先定一個協議2,a view實現協議中的方法3,b view設定一個委託變數4,把b view的委託變數設定成a view,意思就是 ,b view委託a
Time of Update: 2018-12-05
首先實現UIScrollViewDelegate協議:#import <UIKit/UIKit.h>@interface Activity01ViewController : UIViewController<UIScrollViewDelegate>{ UIScrollView *myscrollview;}@property (nonatomic,retain) UIScrollView *myscrollview;@end實現協議的下列方法:#import &
Time of Update: 2018-12-05
1 #import <UIKit/UIKit.h>2 3 @interface UITestViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate>4 {5 6 }7 8 @end 1 // 2 // UITestViewController.m 3 // UITest 4 // 5 6 #import "UITestViewController.h"
Time of Update: 2018-12-05
1 // 2 // UITestViewController.m 3 // UITest 4 // 5 6 #import "UITestViewController.h" 7 8 UIScrollView *myScrollView; 9 UIPageControl *myPageControl; 10 11 @implementation UITestViewController 12 13 -
Time of Update: 2018-12-05
第1章. SMTP概述 1.1. SMTP在郵件通訊過程中的位置SMTP,即簡單郵件傳送協議,所對應RFC文檔為RFC821。同http等多數應用程式層協議一樣,它工作在C/S模式下,用來實現網際網路上的郵件傳送。SMTP在整個電子郵件通訊中所處的位置1所示。
Time of Update: 2018-12-05
參考來自:http://www.cnblogs.com/pengyingh/articles/2341880.html1. NSString轉化為UNICODE String:(NSString*)fname = @“Test”;char fnameStr[10];memcpy(fnameStr, [fname cStringUsingEncoding:NSUnicodeStringEncoding], 2*([fname
Time of Update: 2018-12-05
引入標頭檔:#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 );
Time of Update: 2018-12-05
一、線程的建立和啟動NSThread建立主要有兩種直接方式:[NSThread detachNewThreadSelector:@selector(myThreadMainMethod:) toTarget:self withObject:nil];和NSThread* myThread = [[NSThread alloc] initWithTarget:self
Time of Update: 2018-12-05
//// 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
Time of Update: 2018-12-05
- (void)viewDidLoad { [super viewDidLoad]; CGRect labelFrame = CGRectMake(10,10,200,44); UILabel *myLabel = [[UILabel alloc] initWithFrame:labelFrame]; myLabel.backgroundColor = [UIColor clearColor]; myLabel.textColor = [UIColor
Time of Update: 2018-12-05
1 #import <UIKit/UIKit.h>2 3 @interface UITestViewController : UIViewController <UIPickerViewDataSource, UIPickerViewDelegate>4 {5 6 }7 8 @end 1 // 2 // UITestViewController.m 3 // UITest 4 // 5 6 #import "UITestViewController.h" 7 8
Time of Update: 2018-12-05
開發環境使用的是目前為止最新的穩定版軟體:Mac OS X Lion 10.7 + Xcode
Time of Update: 2018-12-05
參考官方文檔:http://developer.apple.com/library/mac/#documentation/Cocoa/Conceptual/KeyValueObserving/KeyValueObserving.html#//apple_ref/doc/uid/10000177-BCICJDHA看這個概念老久了,遲遲沒能真正的用到,今天總算是使用上了,回頭來把方法補上。大批大批的概念我就不贅述了,看官方最有效。三分步1、保證要添加觀察的類符合kvc2、為屬性添加觀察者
Time of Update: 2018-12-05
通過一個URL,擷取URL中包含的各種資訊。例如: NSURL *url = [NSURL URLWithString:@"http://some-site.com:999/dir1/dir2;param?field-1=value-1&field-2=value-2#anchor1"]; NSLog(@"Scheme: %@", [url scheme]); //方案 NSLog(@"Host: %@", [url host]); //主機
Time of Update: 2018-12-05
一:用spring.NET及Nhibernate時, 在項目處添加Spring_bean.xml這個檔案,使用Spring.Context.IApplicationContext初始化時,例如:xmlFiles[0] = "assembly://SpringNHibernateSample/OKEC.Sample/Spring_bean.xml";IApplicationContext context = new XmlApplicationContext(xmlFiles);
Time of Update: 2018-12-05
gcd非同步多線程操作使用流程,一般在子線程中處理資料,主線程更新介面static dispatch_queue_t loadDealersQueue = NULL; if (!loadDealersQueue) { loadDealersQueue = dispatch_queue_create("com.geelycar.loadactivity.loaddealersqueue", NULL); }
Time of Update: 2018-12-05
參考來自: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/?