Time of Update: 2018-12-05
origin link: http://bynomial.com/blog/?p=52Bynomial CodeTips and thoughts for iPhone OS coders.Fun with layersIn this post, I’ll explain how to add a border, rounded corners, and drop shadow to any UIView using some simple CALayerproperties. I’m
Time of Update: 2018-12-05
當C/C++程式在進行編譯或串連時,常常會看到如error while loading shared libraries的錯誤。主要原因是無法找到某個動態或靜態庫。而這種情況往往產生於使用了除系統庫以外的其它函數庫。 我遇到的情況是使用libpcap時報錯。這是因為一般安裝函數庫,使用make install 方法時,函數庫的.so檔案和.a檔案會被預設複製到/usr/local/lib下。但是這個路徑不在系統的串連庫路徑中,所以會產生錯誤。
Time of Update: 2018-12-05
原帖地址如下:可能有位移,這裡不進行解決。用到的幾個方法代碼如下:使用google 地圖 api 3.0協議解析兩個經緯度,得到行進路線。比較重要的一個方法:} 這個是基本的繪製線路的方法。最後產生一張圖片。地圖置中顯示#pragma mark mapView delegate functions- (void)mapView:(MKMapView *)mapView regionWillChangeAnimated:(BOOL)animated{ route_view.hidden =
Time of Update: 2018-12-05
Launching Your iPhone App Via Custom URL Schemeform http://mobiledevelopertips.com/cocoa/launching-your-own-application-via-a-custom-url-scheme.htmlOne of the coolest features of the iPhone SDK is an application’s ability to “bind” itself to a
Time of Update: 2018-12-05
在主線程裡加入一個loading畫面…… 2 { 3 [window addSubview:view_loading]; 4 [NSThread detachNewThreadSelector:@selector(init_backup:) toTarget:self withObject:nil]; 5 }可以通過performSelectorOhMainThread更新UI元素,比如設定進度條等等。最後消除loading畫面,載入主View。 7 -
Time of Update: 2018-12-05
學習NIO和SSL的結合參考文檔:http://docs.oracle.com/javase/1.5.0/docs/guide/security/jsse/JSSERefGuide.html#KeyClassesNIO中有socketChannel但是沒有sslSocketChannel,據文檔中說,如果要實現ssl的socketChannel會牽涉很多代碼的實現,增加api的複雜程度;ssl的實現也不應該依賴於是NIO還是傳統的基於stream的IO,應該給程式員自己進行組合的自由,因此就沒
Time of Update: 2018-12-05
aop:面向切面編程。我的理解就是:對於多個執行個體對象,把它們碼放在一起,在一個或多個特定位置切上一刀,在這個切面的位置上做一些統一的操作。aop最常用的情境就是日誌。一般來說我們希望在某些函數調用前後記錄日誌。最容易想到的辦法如下:package com.red.myaop.bean;public class EasyLog {/** * @param args */public static void main(String[] args) {EasyLog easy = new
Time of Update: 2018-12-05
form:http://wenxin2009.iteye.com/blog/1681584ios5旋轉螢幕:(以下為關健代碼,附件中有執行個體)豎屏和橫屏是兩個不同的ViewController,在實現時需建兩個viewController //旋轉螢幕- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)toInterfaceOrientation{ if
Time of Update: 2018-12-05
預覽: 第一個View 啟動翻頁特效 進入第二個View設計提示:1.新增兩個ViewControler 分別為 FirstViewController 以及 SecondViewController2.新增兩個xib檔案分別為 FirstView.xib 及 SecondView.xib3.xib指定File's Owner內的Class為各自的ViewController4.連結File's Owner內的view為View5.調整View的大小為416(480扣除上方的status
Time of Update: 2018-12-05
使用NSTimer與iphone的簡單動畫,實現飄雪效果,這理原理比較簡單,就是定時產生一定的雪花圖片,然後使用動畫的方式向下漂落(我在其它論壇,看到使用path的方式實現的一個雲漂來漂去的效果,實際也可以用那種方式實現,這實際就是前面說的動畫效果的兩種應用)。所以,我們可以在 viewDidLoad事件中,增加一個圖片及定時器並啟動,這裡的pic請在標頭檔中定義。-(void)viewDidLoad{ [super viewDidLoad]; self.pic = [UIImage
Time of Update: 2018-12-05
程式啟動畫面 自動進行淡出效果以淡入的方式進入程式主畫面SplashDemoAppDelegate.h#import <UIKit/UIKit.h>#import "SplashViewController.h"@class SplashDemoViewController;@interface SplashDemoAppDelegate : NSObject <UIApplicationDelegate> { UIWindow *window;
Time of Update: 2018-12-05
from:http://hi.baidu.com/sonnywh/blog/item/6d89b68b8c6234649f2fb43c.html- (void)pushAnimationDidStop {}- (void)pushViewController: (UIViewController*)controller animatedWithTransition: (UIViewAnimationTransition)transition { [self
Time of Update: 2018-12-05
這是一個解釋javabean的容器原理的例子,有像spring容器的意思, 實現了annotation在setter方法上注入的效果,我沒有看過spring或其他ejb容器的代碼,自己猜測javabean容器應該就是這樣實現的,所謂的DI或者叫ioc的就是這樣做到的,利用xml設定檔和用annotation方法沒有太大區別,兩者都是為了描述注入點和注入對象。 先寫一個被注入的類:package com.red.beans;public class SourceBean {public void
Time of Update: 2018-12-05
from:http://hi.baidu.com/johnzhjfly/blog/item/ae8b7dd139dd7ac8572c84c4.htmlCLLocationManagerCLLocationManager使用步驟1.建立一個CLLocationManager執行個體CLLocationManager *locationManager = [[CLLocationManager alloc]
Time of Update: 2018-12-05
java 的容器安全執行緒1.HashSet 非安全執行緒【1】 2.TreeSet 非安全執行緒 【2】3.LinkedHashSet 非安全執行緒 【3】4.ArrayList 非安全執行緒 【4】5.LinkedList 非安全執行緒 【5】6.HashMap 非安全執行緒 【6】7.TreeMap 非安全執行緒 【7】8.LinkedHashMap 非安全執行緒 【8】 9.HashTable 安全執行緒 【9】10.Vector 安全執行緒
Time of Update: 2018-12-05
這個例子是為了熟悉jms的開發流程。效果是一個servlet向一個message driven
Time of Update: 2018-12-05
from:http://torrlau.blog.163.com/blog/static/176797261201143095659490/ 寫在最前面:這款軟體是將你的appstore帳號通過mobile me郵箱綁定到你的iphone裝置上,也就是說,只要下載並設定成功,你可以隨時通過該軟體檢測你的iphone產品的位置。第一次需要在你想定位的apple裝置中下載安裝“尋找我的iphone”這個應用程式。按步驟2註冊(整個過程和定位服務一切都是免費的,不算手機3g上網流量)。
Time of Update: 2018-12-05
iphone讀取addressbook:1.添加addressbook.framework2.在需要的源檔案中 #import <AddressBook/AddressBook.h>#import <AddressBookUI/AddressBookUI.h> 3.開始粘代碼://get all people info from the address bookABAddressBookRef addressBook = ABAddressBookCreate(
Time of Update: 2018-12-05
aop技術一般用於某個對象的函數調用的日誌,認證等。webservice是遠端函數調用,也需要類似的aop方法,舉例jax-ws的webservice,handler就相當於aop。 舉一例jax-ws handler例子 先寫個webservice import javax.jws.HandlerChain;import javax.jws.WebMethod;import
Time of Update: 2018-12-05
今天開始研究安裝 cocos2d,先下載安裝了cocos2d-x,然後又安裝cocos2d,結果各種失敗。刪掉cocos2d-x (終端輸入 chflags nohidden ~/library/