目前分類:ios開發筆記 (78)

瀏覽方式: 標題列表 簡短摘要
-(NSString*) uuid {
    CFUUIDRef puuid = CFUUIDCreate( nil );
    CFStringRef uuidString = CFUUIDCreateString( nil, puuid );
    NSString * result = (NSString *)CFBridgingRelease(CFStringCreateCopy( NULL, uuidString));
    CFRelease(puuid);
    CFRelease(uuidString);
    return result ;

}

戮克 發表在 痞客邦 留言(0) 人氣()

今天測試當iOS的圖形元件透明度為零時,元件會消失。
所以如果要做透明按扭扭的方式
可以把按鈕的字串改成空白鍵多按幾次
背景設為無底色
設好長寬程式執行可以點擊
但看不到
就達到透明按鈕的效果

戮克 發表在 痞客邦 留言(0) 人氣()

        XCODE裡面有自動備份專案的功能,如果有不小心寫道專案個毀掉的朋友就可以用他來還原你的專案了。聽說會自動備份!疑!還是手動比較保險。
開啟備份的地方

選擇PROJECT

備份就是在紅框的位置

可以匯出或刪除

從File選項裡可以新增快照

新增的畫面

新增的快照(備份)顯示的資訊

還原快照的方式

戮克 發表在 痞客邦 留言(0) 人氣()

- (void)viewWillAppear:(BOOL)animated
{
    [super viewWillAppear:animated];

}

戮克 發表在 痞客邦 留言(0) 人氣()

存擋
 NSUserDefaults* pref=[NSUserDefaults standardUserDefaults];
    [pref setObject:@"Y" forKey:@"templogin"];
讀檔
 NSUserDefaults *userDefaultesQ = [NSUserDefaults standardUserDefaults];
NSString *showtemplogin = [userDefaultesQ stringForKey:@"showtemplogin"];
    if ([showtemplogin isEqualToString:@"Y"]) {
        [self.btnNonMember setHidden:NO];
    }else{

戮克 發表在 痞客邦 留言(0) 人氣()

ios8從56 bytes擴增到2 kilobytes.
可以在推播內加上更多資訊了



Each remote notification includes a payload. The payload contains information about how the system should alert the user as well as any custom data you provide. In iOS 8 and later, the maximum size allowed for a notification payload is 2 kilobytes; Apple Push Notification service refuses any notification that exceeds this limit. (Prior to iOS 8 and in OS X, the maximum payload size is 256 bytes.)

官方參考:
https://developer.apple.com/library/ios/documentation/NetworkingInternet/Conceptual/RemoteNotificationsPG/Chapters/ApplePushService.html#//apple_ref/doc/uid/TP40008194-CH100-SW9

戮克 發表在 痞客邦 留言(0) 人氣()

        最近在寫APNS推播,終於有點成果了。經過了一連串的波折參考大陸網站與美國網站寫出來的成果。明天繼續把它前台和後台未完成的地方趕完。雖然程式部分跟ANDROID相比好寫多了,但相對的設定方面複雜很多。後台也較為複雜。GCM可以用ASP3.0、PHP、JSP、.NET,而APN不能用ASP3.0阿...偏偏公司簡易後台是用ASP寫的。就乖乖認命寫
PHP和.NET版本的了。





戮克 發表在 痞客邦 留言(0) 人氣()

NSString *textToShare = @"";
    UIImage *imageToShare = [UIImage imageWithContentsOfFile:path];
    NSArray *itemsToShare = @[textToShare, imageToShare];
    
    
    UIActivityViewController *activityVC = [[UIActivityViewController alloc] initWithActivityItems:itemsToShare applicationActivities:nil];
    activityVC.excludedActivityTypes = @[UIActivityTypePrint, UIActivityTypeCopyToPasteboard, UIActivityTypeAssignToContact, UIActivityTypeSaveToCameraRoll]; //or whichever you don't need
    [self presentViewController:activityVC animated:YES completion:nil];

戮克 發表在 痞客邦 留言(0) 人氣()

- (UIImage *)addImage:(UIImage *)image1 toImage:(UIImage *)image2 {
    UIGraphicsBeginImageContext(image1.size);
    [image1 drawInRect:CGRectMake(0, 0, image1.size.width, image1.size.height)];
    [image2 drawInRect:CGRectMake(0, 0, image2.size.width, image2.size.height)];
    UIImage *resultingImage = UIGraphicsGetImageFromCurrentImageContext();
    UIGraphicsEndImageContext();
    return resultingImage;

}

戮克 發表在 痞客邦 留言(0) 人氣()

As we announced in October, beginning February 1, 2015 new iOS apps submitted to the App Store must include 64-bit support and be built with the iOS 8 SDK. Beginning June 1, 2015 app updates will also need to follow the same requirements. To enable 64-bit in your project, we recommend using the default Xcode build setting of “Standard architectures” to build a single binary with both 32-bit and 64-bit code.



意思是明年上架所有的APP需使用64位元架構,沒有使用的話就不能上架。代表有一波舊地APP更新潮!!!

戮克 發表在 痞客邦 留言(0) 人氣()

 請參考
https://github.com/jdg/MBProgressHUD
直接把
MBProgressHUD.h
MBProgressHUD.m
檔案夾到專案裡就可以使用
使用方式importMBProgressHUD.h

[p[self showAllTextDialog:@"Email 格式錯誤"];

戮克 發表在 痞客邦 留言(0) 人氣()

 NSString* Text = [[NSString alloc] initWithFormat:@"%f", result];
                                                                 NSString* Text1=@"您的腳長約";
                                                                 NSString* Text2=@"公分";
                                                                 //將三個字串連結在一起

                                                                 NSString *ConText = [NSString stringWithFormat:@"%@%@%@", Text1,Text, Text2];

戮克 發表在 痞客邦 留言(0) 人氣()

- (void) textFieldDidBeginEditing:(UITextField*)textField {
    NSLog(@"textFieldDidBeginEditing:%@",textField.text);
}

// 可能進入結束編輯狀態
- (BOOL)textFieldShouldEndEditing:(UITextField *)textField {
    NSLog(@"textFieldShouldEndEditing:%@",textField.text);
    return true;
}

戮克 發表在 痞客邦 留言(0) 人氣()

[tname.text isEqualToString:@""]||[tname.text isEqualToString:nil]

戮克 發表在 痞客邦 留言(0) 人氣()

之前寫的ios7程式碼使用TextField
可以直接用
self.address.delegate = self;
    

self.addressext.delegate = self;
但最近寫的這到ios 8 環境出現錯誤
Assigning to 'id<    >' from incompatible type ' *const __strong'
最後參考這篇
http://www.4byte.cn/question/244971/ios-and-xcode-incompatible-type-error-when-setting-delegate-and-datasource-in-a-uitableview.html 

戮克 發表在 痞客邦 留言(0) 人氣()

UILabel使用text _label1.text = [NSString stringWithFormat:@"Current Page %d",page+1];
UIbutton沒有
必須使用Title
[button setTitle:@"低家!!" forState:0];

戮克 發表在 痞客邦 留言(0) 人氣()

想要文字置中的效果在ios6可以用
 title.textAlignment = UITextAlignmentCenter;
來使文字置中

但在ios六版本之後就會發生錯誤:
Assigning to 'NSTextAlignment' from incompatible type 'UITextAlignment'

必須改用下列程式碼來置中
   title.textAlignment = NSTextAlignmentCenter;

戮克 發表在 痞客邦 留言(0) 人氣()

[self.navigationController popViewControllerAnimated:YES];

戮克 發表在 痞客邦 留言(0) 人氣()

 CGImageRef imgReff =image.CGImage;
                                                                 CGImageRef finalImgReff=CGImageCreateWithImageInRect(imgReff,CGRectMake(0, 0, imagedeeet.size.height/3, imagedeeet.size.width));
                                                                 

                                                                 UIImage *destImgfeet=[UIImage imageWithCGImage:finalImgReff];

戮克 發表在 痞客邦 留言(0) 人氣()

NSString *htmlString = @"<div><font color=\"#996633\"><b>Q.我該穿襪子或拖襪?</b></font></div><div>A:穿襪或脫襪皆可,穿襪需純色襪子。花色襪子可能會造成影像辨識錯誤。</div><div><b><font color=\"#996633\">Q.拍照背景會影響準確度嗎?</font></b></div><div>A:請保持純色背景。如單一顏色地板。深色淺色皆可。但須避免與硬幣同色系。</div><div><font color=\"#996666\"><b>Q.影響準確度的原因?</b></font></div><div>A:光線太強、襪子顏色、背景顏色、姿勢皆有可能影響準確度。建議穿著純色襪子搭配純色地板,在光線充足的環境下拍照。</div><div><font color=\"#996633\"><b>Q.拍照角度的影響</b></font></div><div>A:拍照與地面保持平行,確保硬幣與腳在同一個平面上並對準螢幕上之圖示拍照。同時避免自身陰影覆蓋到拍照範圍。</div><div>";
    NSAttributedString *attributedString = [[NSAttributedString alloc] initWithData:[htmlString dataUsingEncoding:NSUnicodeStringEncoding] options:@{ NSDocumentTypeDocumentAttribute: NSHTMLTextDocumentType } documentAttributes:nil error:nil];


以上是字串宣告
在使用時請使用
 textLabel.attributedText = attributedString;

戮克 發表在 痞客邦 留言(0) 人氣()