網頁

2014年4月25日 星期五

【xCode】Build Setting Reference

【環境:xCode5.x】

官網參考資料
Build Setting Reference

利用workspace產生共用的lib,通常會想指定lib存取的位置
如此產生多個project時,多人共同作業,較為順利


1.首先針對static lib,如下圖:

 2.選擇你要放入的檔案,唯一較為特別的是,指定你的header的存放路徑



3.選擇你的專案,並且搜尋『search』,找到header路徑,注意build為你當下workspace中的子路徑,可自行命名,記住選擇recursive:

4.同上選擇你的專案,在你的lib paths中,填入如圖資訊:

ps:注意當你要切割成release與debug版本時,若加入$(CONFIGURATION)$(EFFECTIVE_PLATFORM_NAME),則一並于product中的path亦需加入,否則xcode透過recursive無法辨識出,你要用的版本。


其他:關於直接透過.sh 利用lipo產生文件
http://www.cnblogs.com/xiaodao/archive/2012/03/28/2422091.html


As always , if you have any question , feel free to contact me.
有任何問題,請聯絡我

歡迎轉載,請註明出處,感謝。

2014年4月2日 星期三

【Objc】將圖片轉為tiff存檔

【環境:xCode 5 , arc】
宣告:
名稱:
說明:將取得的圖片轉為tiff格式,並存起來。


 
NSString *myPath = [[NSBundle mainBundle] pathForResource:@"IMG_2733" ofType:@"JPG"];
    NSURL *myURL = [NSURL fileURLWithPath:myPath];
    CGImageSourceRef mySourceRef = CGImageSourceCreateWithURL((CFURLRef)myURL, NULL);
    NSDictionary *myMetadata = (NSDictionary *) CGImageSourceCopyPropertiesAtIndex(mySourceRef,0,NULL);
    NSDictionary *exifDic = [myMetadata objectForKey:(NSString *)kCGImagePropertyExifDictionary];
    NSDictionary *tiffDic = [myMetadata objectForKey:(NSString *)kCGImagePropertyTIFFDictionary];
    NSLog(@"exifDic properties: %@", myMetadata); //all data
    float rawShutterSpeed = [[exifDic objectForKey:(NSString *)kCGImagePropertyExifExposureTime] floatValue];
    int decShutterSpeed = (1 / rawShutterSpeed);
    NSLog(@"Camera %@",[tiffDic objectForKey:(NSString *)kCGImagePropertyTIFFModel]);
    NSLog(@"Focal Length %@mm",[exifDic objectForKey:(NSString *)kCGImagePropertyExifFocalLength]);
    NSLog(@"Shutter Speed %@", [NSString stringWithFormat:@"1/%d", decShutterSpeed]);
    NSLog(@"Aperture f/%@",[exifDic objectForKey:(NSString *)kCGImagePropertyExifFNumber]);
    NSNumber *ExifISOSpeed  = [[exifDic objectForKey:(NSString*)kCGImagePropertyExifISOSpeedRatings] objectAtIndex:0];
    NSLog(@"ISO %i",[ExifISOSpeed integerValue]);
    NSLog(@"Taken %@",[exifDic objectForKey:(NSString*)kCGImagePropertyExifDateTimeDigitized]); 

As always , if you have any question , feel free to contact me.
有任何問題,請聯絡我

歡迎轉載,請註明出處,感謝。