Time of Update: 2013-12-10
前不久完成了在Java ME,BlackBerry, Android, Java SE, .Net CE, .Net Desktop平台上地圖開發包開發工作。終於有時間開始學習Mac OS, iPhone開發。最終目標是將地圖開發包移植到Mac OS 和 iPhone平台上。做軟體開發很多年來,一直沒有機會接觸Mac
Time of Update: 2013-12-10
使用方法如下:建立/添加一個zip包ZipArchive* zipFile = [[ZipArchive alloc] init];//次數得zipfilename需要一個完整得路徑,例如***/Documents/demo.zip[zipFile CreateZipFile2:@"zipfilename"];//有兩種可選得方式進行建立壓縮包,帶密碼和不帶密碼的[[zipFile CreateZipFile2:@"zipfilename"
Time of Update: 2013-12-10
// UIView+ColorOfPoint.h@interface UIView (ColorOfPoint)- (UIColor *) colorOfPoint:(CGPoint)point;@end// UIView+ColorOfPoint.m#import "UIView+ColorOfPoint.h"#import <QuartzCore/QuartzCore.h>@implementation UIView (ColorOfPoint)-
Time of Update: 2013-12-10
1@synthesize window=_window;2@synthesize viewController=_viewController;通常看到的都沒有包含=部分,@synthesize window=_window; 怎麼理解?這裡的 _window 和 _viewController 是什麼變數?.h 檔案中在類中沒有定義 window 和 viewController 執行個體變數,怎麼能進行 @perproty 聲明呢?1#import <UIKit/UIKit.h>
Time of Update: 2013-12-10
刪除toolkit:listpicker綁定的最後一個元素會拋出SelectedItem must always be set to a valid value這個異常。目測是這段代碼的問題: 01private static void OnSelectedItemChanged(DependencyObject o, DependencyPropertyChangedEventArgs e)02 {0
Time of Update: 2013-12-10
IOS中的動畫右兩大類1.UIView的視圖動畫2.Layer的動畫 UIView的動畫也是基於Layer的動畫動畫的代碼格式都很固定1.UIView動畫一般方式[UIView beginAnimations:@"ddd" context:nil];//設定動畫[UIView commitAnimations]; //提交動畫這兩個是必須有的,然後在兩句的中間添加動畫的代碼[UIView beginAnimations:@"ddd"
Time of Update: 2013-12-10
UIPageController是大多數IOS教程上不會寫的系統內建控制項。它主要的功能是實現視圖分頁,有點類似於網頁上的分頁功能。這次主要通過一個例子來講講UIPageController控制項和UIScrollView的應用。首先: 圖中標有紅框的地方,便是UIPageController的展現樣式,在xcode裡它是這個樣子的:現在要開始使用UIPageController控制項了,首先在申明檔案頂部添加一個常量,來定義滾圖中的子項數量 #define PAG
Time of Update: 2013-12-10
時刻銘記著views的生命週期 不要在init的方法中訪問self.view 使用data source protocols(資料來源協議)來明顯地將data從view上區分開來UIViewController 使用已經存在的navigationitem對象NSObject
Time of Update: 2013-12-10
昨天寫了重力感應的例子,我覺得這個例子比較有用處,我分享出來:1 )顯然ios4 之後可以使用coreMotion的framework 為了向下相容加上UIAccelerator,[html]#import <Foundation/Foundation.h> #import <CoreMotion/CoreMotion.h> @protocol
Time of Update: 2013-12-10
糾結了兩天的問題,終於找到原因了!錯誤情形:類的成員變數NSArray array.經過@property(nonatomic,copy)和@synthesize。在類的初始化方法裡對array賦值array=[result objectForKey:@"list"];列印array:NSLog(@"array is %@",array);結果正常。然後將array作為tableview的資料來源,一直出現問題。-(NSInteger)tableView:
Time of Update: 2013-12-10
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:cellStr]; if (cell == nil) { cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault
Time of Update: 2013-12-10
UIKit中有一些類可以用來操縱單個映像,還有一個映像類可以用來顯示映像。Apple還提供了一種特殊的導航控制器,用於從映像庫中選擇映像。UIImage類對映像及其底層資料進行封裝。它可以直接繪製在一個視圖內,或者作為一個映像容器在另一個更大的映像視圖容器中使用。這個類類提供的方法可以用來從各種來源中載入映像,在螢幕上設定圖片的方向,以及提供有關映像的資訊。對於簡單的圖形應用,可以將UIImage對象用在視圖類的drawRect方法中,用來繪製映像和團模板。你可以用檔案來初始化,也可以用url、
Time of Update: 2013-12-10
object creation:An object comes into runtime existence through a two-step process that allocates memory for the object and sets its state to reasonable initial values. To allocate an Objective-C object, send an alloc or allocWithZone: message
Time of Update: 2013-12-10
1.建立Phonegap工程MyPlugin環境xcode4.5.1phonegap2.1.02.在Plugin檔案夾下建立實現Plugin子類[plain] // // MyPlugin.h // MyPGPlugin // // Created by kllmctrl on 12-10-29. // // #import <Cordova/CDV.h>&
Time of Update: 2013-12-10
要求:1、從基於Xcode空項目模板開始 2、兩頁之間能相互傳遞資料
Time of Update: 2013-12-10
最近開發的ios項目,由於需要向伺服器發送,本應用的活躍手機量。通過擷取手機的唯一標示符UUID或者MAC地址。由於IOS5以後,不支援擷取uuid,因此擷取MAC地址。下面的代碼複用率極高,可以作為很重要的參考。 #pragma mark MAC// Return the local MAC addy// Courtesy of FreeBSD hackers email list// Accidentally munged during previous update.
Time of Update: 2013-12-10
考慮到緩衝實現多數使用單例模式,這裡使用C++的模版方式設計了一個Singlton基類,這樣以後只要繼承該類,子類就會支援單例模式了。其代碼如下: [cpp] // // SingltonT.h // #ifndef SingltonT_h #define SingltonT_h #include <iostream>
Time of Update: 2013-12-10
.h檔案[plain] @interface Interface1 : UIViewController { IBOutlet UIScrollView *scroller; IBOutlet UILabel *warnung; } @property (nonatomic,
Time of Update: 2013-12-10
obj-c本質就是"改進過的c語言",大家都知道c語言是沒有記憶體回收(GC)機制的(註:雖然obj-c2.0後來增加了GC功能,但是在iphone上不能用,因此對於iOS平台的程式員來講,這個幾乎沒啥用),所以在obj-c中寫程式時,對於資源的釋放得由開發人員手動處理,相對要費心一些。引用計數這是一種古老但有效記憶體管理方式。每個對象(特指:類的執行個體)內部都有一個retainCount的引用計數,對象剛被建立時,retainCount為1,可以手動調用retain方法使
Time of Update: 2013-12-10
1 前言上一次我們介紹了Storyboard的簡單建立方法,這次我們來介紹一下如何通過Storyboard進行兩個ViewController之間的傳值。2 代碼執行個體2.1 建立一個不帶nib檔案ViewController檔案 2.2 將Storyboard中的第二個視圖控制器的類設定為建立的SecondView 2 .3