浮點數處理並去掉多餘的0,浮點數代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. NSLog(@"--float-%@-",[self stringDisposeWithFloat:9.000899990000]); }//浮點數處理並去掉多餘的0-(NSString
將400電話中間加上-線,400電話-線代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. NSLog(@"--iphone--%@",[self getNewPhoneStr1:@"18502368888"]); }//只需傳一個電話進去,可以返回一個處理好的加了-線的400電話字串,如傳4001234567,返回400-1
通過顏色來產生一個純色的圖片,產生純色圖片 :代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. UIImageView *imageView=[[UIImageView alloc]initWithFrame:CGRectMake(50, 100, 200, 200)];
傳社會安全號碼碼可返回生日字串,社會安全號碼碼字串 代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. NSString *birthDay=[self birthdayStrFromIdentityCard:@"134825194401014241"];
利用圖片序列建立動態圖片效果,圖片序列建立動態代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. //顯示圖片的UIImageView UIImageView *imageview=[[UIImageView alloc]initWithFrame:CGRectMake(50, 100, 200, 200)];
縮放圖片,並截取中間位置顯示,縮放圖片截取位置代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. UIImage *imagePicture=[UIImage imageNamed:@"1.jpg"]; UIImageView *imageView=[[UIImageView
檢測手機翻轉,手機翻轉代碼:- (void)viewDidLoad{ [super viewDidLoad]; // Do any additional setup after loading the view. //監聽手機方向改變事件 [[NSNotificationCenter defaultCenter] addObserver:self