Time of Update: 2013-12-10
下面純屬自己猜測,沒看到過官方文檔說明。 很早以前剛接觸IOS的時候,就思考過一個問題,只是沒有想明白,上網找資料差文檔也沒發現個所以然來。 今天偶然間,展開項目中匯入的framework,發現其實標頭檔中經常出現類似於這種 #import <QuartzCore/QuartzCore.h> 的寫法結構並不是沒有道理的。其實應該是匯入標頭檔具體路徑加檔案名稱吧。至於其中framework中多餘的那個Headers應該是跟“New
Time of Update: 2013-12-10
直接入主題,標籤講解1、<c:import>標籤JSP裡面有<% file include="XX"%> 與<jsp:include>,JSTL也提供了實現include功能的標籤<c:import>,不過這個功能強大多了它比JSP<% page import="XX"%>功能強大甚至可以把Internet上的網頁包含進來<c:import
Time of Update: 2013-12-10
iOS宏編譯的兩種方法 第一種 適合修改原基礎上得調試代碼 #ifdef DEBUG #define NSLog(...) NSLog(__VA_ARGS__)#define debugMethod() NSLog(@"%s", __func__)#else#define NSLog(…)#define debugMethod()#endif----------------------------------------
Time of Update: 2013-12-10
多線程編程是防止主線程堵塞,增加運行效率等等的最佳方法。而原始的多線程方法存在很多的毛病,包括線程鎖死等。在Cocoa中,Apple提供了NSOperation這個類,提供了一個優秀的多線程編程方法。 本次介紹NSOperation的子集,簡易方法的NSInvocationOperation: @implementation MyCustomClass - (void)launchTaskWithData:(id)data{ //
Time of Update: 2013-12-10
UIView *view = [[[[[UIApplication sharedApplication] windows] objectAtIndex:1] subviews] lastObject];//獲得某個window的某個subView NSInteger index = 0;//用來給儲存的png命名 for (UIView *subView in [view
Time of Update: 2013-12-10
代碼: //選擇按鈕 NSArray *buttonNames = [NSArray arrayWithObjects:@"今天", @"本周", @"本月", nil]; UISegmentedControl* segmentedControl = [[UISegmentedControl alloc]
Time of Update: 2013-12-10
工欲善其事,必先利其器。在開發iPhone應用程式的時候,深入理解iPhone OS/SDK與Objective-C 2.0是很重要的。iPhone OSiPhone OS 由4個主要部分組成。下面簡單地羅列一下它們的功能。Cocoa Touch視窗和視圖事件管理使用者介面加速感應器照相機MediaCore Graphics(2維圖形介面)Core Animation(動畫)OpenGLCore Audio(聲音)OpenALMedia Player(MPEG4,MP3)Core
Time of Update: 2013-12-10
預設,所有iOS裝置在過了設定的休眠時間後,都會自動鎖屏。如果你的應用不希望iOS裝置自動鎖屏,可以使用以下方式來保持螢幕一直開著。 Ios代碼 [[UIApplication sharedApplication] setIdleTimerDisabled: YES]; 或者 [UIApplication sharedApplication].idleTimerDisabled =
Time of Update: 2013-12-10
Java代碼 最近在做使用者管理程式,在做的過程中使用者註冊資訊校正在網上查了好久,沒查到現成的代碼,只能自己寫了, 最近在做使用者管理程式,在做的過程中使用者註冊資訊校正在網上查了好久,沒查到現成的代碼,只能自己寫了,Java代碼 代碼放在這裡,有需要直接拿去。自己也做備份,以後使用方便。 代碼放在這裡,有需要直接拿去。自己也做備份,以後使用方便。Java代碼 //校正使用者名稱 + (
Time of Update: 2013-12-10
在iPhone開發中,我們常常需要在不同的頁面之間做動畫的切換,這樣看起來更加好看。基本的動畫有以下三種:1.UIViewUIView官方提供五種動畫效果供大家使用,分別為:UIViewAnimationTransitionNone 不使用動畫UIViewAnimationTransitionFlipFromLeft
Time of Update: 2013-12-10
NSString *str1 = [NSString stringWithString:@"str1"];NSString *str2 = @"str2";NSString *str3 = [NSString stringWithFormat:@"%@", @"str3"];NSString *str4 = [[NSString alloc]
Time of Update: 2013-12-10
準備 iPad 開發,由於使用IOS SDK 4.3 , 很多老的書的介面與此不符,只好看英文的說明了。 一篇小小的 HelloWorld 居然看了 n 個小時。。。。。。寫了快30年程式了,實在汗顏。 痛點有三:1 介面不熟 (IOS SDK 4.3 變化較大)2 語言障礙 (英語還是不如母語呀)3 程式架構 (完全不瞭解) 打算每天寫些,希望能對剛開始用IOS SDK 4.3
Time of Update: 2013-12-10
在 iPhone101.pdf P30 關於 File's Owner 有這樣一段描述 In a nib file, in contrast to the other objects you add to the interface, the File’s Owner object is not created when the nib file is loaded. It represents the object set to be the owner in
Time of Update: 2013-12-10
Objective-C資料類型可以分為:基礎資料型別 (Elementary Data Type)、物件類型和id類型。基礎資料型別 (Elementary Data Type)有:int、float、double和char類型。物件類型就是類或協議所聲明的指標類型,例如:NSAutoreleasePool * pool,其中NSAutoreleasePool是一個類,NSAutoreleasePool *是它指標類型。id類型可以表示任何類型,一般只是表示物件類型,不表示基礎資料型別
Time of Update: 2013-12-10
NSString *URL =@"http://xxx.jpg"; NSData *imageData = [[NSDataalloc]initWithContentsOfURL:[NSURLURLWithString:URL]]; UIImage *image=[[UIImagealloc] initWithData:imageData]; [imgADBanner
Time of Update: 2013-12-10
-(IBAction)addPicEvent{ UIImagePickerControllerSourceType sourceType=UIImagePickerControllerSourceTypeCamera; if (![UIImagePickerControllerisSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera])
Time of Update: 2013-12-10
在處理字串的時候,常常會用到Regex,在iphone os上也不例外。使用 RegexKit Frameworkhttp://regexkit.sourceforge.net/RegexKitLite/index.html 就可以了。在這裡http://downloads.sourceforge.net/regexkit/RegexKitLite-4.0.tar.bz2 下載RegexKitLite。解壓 RegexKitLite-4.0.tar.bz2
Time of Update: 2013-12-10
解析XML檔案樣本.代碼1和代碼2是IOS開發的基本內容。代碼1.#import <UIKit/UIKit.h> @class XmlTestViewController; @interface XmlTestAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window;
Time of Update: 2013-12-10
首先,寫一個類,繼承於UIButton。 標頭檔:Ios代碼 #import <Foundation/Foundation.h> @interface BlueButton : UIButton { } - (id)init; @end 1 實現檔案: 2 3
Time of Update: 2013-12-10
Java代碼 1. [b]如何擷取view的controller[/b] 2. 3. //擷取view的controller 4. - (UIViewController *)viewController { 5. for (UIView* next = [self superview]