Below is the text of the page https://www.developers-life.com/ stored 2011-07-08 by archive.org.ua. The original page over time could change. View as original html

Notes of a Developer - Develop on Objective-C, UIKit, C, OpenGL

Notes of a Developer [http://www.developers-life.com] Develop on Objective-C, UIKit, C, OpenGL for iPhone, iPad, Mac OS X Home About About Alex Subscribe RSS Setting the text color of an NSButton Categories: Mac OS X on Apr.20, 2011 Here’s a simple little category on NSButton which adds -textColor and -setTextColor: methods to the class. Header: 1 2 3 4 5 6 7 #import @interface NSButton ( TextColor ) - ( NSColor * ) textColor; - ( void ) setTextColor : ( NSColor * ) textColor; @end Implementation: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 #import "NSButton+TextColor.h" @implementation NSButton ( TextColor ) - ( NSColor * ) textColor { NSAttributedString * attrTitle = [ self attributedTitle ] ; int len = [ attrTitle length ] ; NSRange range = NSMakeRange ( 0 , MIN ( len, 1 ) ) ; // take color from first char NSDictionary * attrs = [ attrTitle fontAttributesInRange : range ] ; NSColor * textColor = [ NSColor controlTextColor ] ; if ( attrs ) { textColor = [ attrs objectForKey : NSForegroundColorAttributeName ] ; } return textColor; } - ( void ) setTextColor : ( NSColor * ) textColor { NSMutableAttributedString * attrTitle = [ [ NSMutableAttributedString alloc ] initWithAttributedString : [ self attributedTitle ] ] ; int len = [ attrTitle length ] ; NSRange range = NSMakeRange ( 0 , len ) ; [ attrTitle addAttribute : NSForegroundColorAttributeName value : textColor range : range ] ; [ attrTitle fixAttributesInRange : range ] ; [ self setAttributedTitle : attrTitle ] ; [ attrTitle release ] ; } @end source Tags: Mac OS X , NSButton , NSColor , NSMutableAttributedString , objective-c Leave a Comment ( 2 votes, average: 5.00 out of 5) Loading ... Вакансии Injoit Ltd Categories: others on Apr.15, 2011 Leave a Comment (No Ratings Yet) Loading ... How to include ttf fonts to iOS app Categories: iPad , iPhone on Apr.14, 2011 Up till now there hasn’t been an easy way to add custom fonts to your iPhone applications. As of iOS 4 it has become very easy to do. Here is what you need to do in order to add custom fonts: Add your custom font files into your project using XCode as a resource Add a key to your info.plist file called UIAppFonts. Make this key an array For each font you have, enter the full name of your font file (including the extension) as items to the UIAppFonts array Save info.plist Now in your application you can simply call [UIFont fontWithName:@"CustomFontName" size:12] to get the custom font to use with your UILabels and UITextViews, etc… It’s that simple! Tags: plist , UIFont , xCode 3 comments ( 1 votes, average: 5.00 out of 5) Loading ... Основы Grand Central Dispatch Categories: Apple , Mac OS X , iPhone on Apr.08, 2011 В предыдущих статьях писал, что хотел перевести одну интересную статью с английского, но вот нашел перевод хорошей статьи на русский . Думаю автор перевода не будет против если я копию возьму себе :) Что это? Grand Central Dispatch, или, ко­рот­ко, GCD — это низ­ко­уров­не­вое API, ко­то­рая от­кры­ва­ет но­вый спо­соб ра­бо­тать с па­рал­лель­ны­ми (ори­ги­наль­но это concurrent, а не parallel, я не знаю нор­маль­но­го пе­ре­во­да, ес­ли кто ска­жет — на­пи­ши­те в ком­мен­та­ри­ях, прим. пер.) про­грам­ма­ми. На са­мом про­стом уровне по­ни­ма­ния, ме­то­до­ло­гия по­хо­жа на NSOperationQueue , ко­то­рая поз­во­ля­ет раз­би­вать про­грам­му на неза­ви­си­мые за­да­чи, ко­то­рые за­пус­кать па­рал­лель­но или по­сле­до­ва­тель­но. GCD ра­бо­та­ет на бо­лее низ­ком уровне, предо­став­ля­ет боль­шую про­из­во­ди­тель­ность и не яв­ля­ет­ся ча­стью Cocoa. В до­пол­не­ние к сред­ствам па­рал­лель­но­го вы­пол­не­ния ко­да, GCD та­к­же предо­став­ля­ет пол­но­стью ин­те­гри­ро­ван­ную си­сте­му об­ра­бот­ки со­бы­тий. Об­ра­бот­чи­ки мо­гут быть скон­фи­гу­ри­ро­ва­ны та­ким об­ра­зом, что­бы ре­а­ги­ро­вать на со­бы­тия от фай­ло­вых де­скрип­то­ров, си­стем­ных пор­тов и про­цес­сов, тай­ме­ров и сиг­на­лов, и на поль­зо­ва­тель­ские со­бы­тия. Эти об­ра­бот­чи­ки ис­пол­ня­ют­ся па­рал­лель­но при по­мо­щи ин­фра­струк­ту­ры GCD. API GCD пол­но­стью ос­но­ван на так на­зы­ва­е­мых бло­ках, о ко­то­рых я го­во­рил в преды­ду­щих се­ри­ях от­ве­тов на во­про­сы («Поз­воль­те пред­ста­вить»: бло­ки и «Об­суж­де­ние прак­ти­че­ских ас­пек­тов ис­поль­зо­ва­ния бло­ков в обыч­ном ко­де»). GCD мож­но ис­поль­зо­вать и без бло­ков, при­ме­няя тра­ди­ци­он­ные C-​шные ме­ха­низ­мы ука­за­те­лей на функ­ции и кон­тек­ста, но ис­поль­зо­вать бло­ки го­раз­до про­ще и неве­ро­ят­но удоб­нее с прак­ти­че­ской точ­ки зре­ния. Для по­лу­че­ния си­стем­ной до­ку­мен­та­ции по GCD, мож­но на­брать man dispatch в ко­манд­ной стро­ке, ес­ли у вас Snow Leopard. [Read more...] Tags: GCD , iOS , iPad , iPhone , Mac OS X , objective-c , OOP , Кодинг Leave a Comment ( 3 votes, average: 5.00 out of 5) Loading ... Adding SVN revision to Xcode project Categories: Apple , Mac OS X , iPad , iPhone on Feb.23, 2011 Просмотр ревизии в самом приложении предотвращает путаницу и всякие проблемы с отслеживанием текущей версии. Чтоб отслеживать версию репозитория нам нужно добавить слдеющий код bash скрипта. 1 2 3 4 5 6 7 8 9 10 REVISION = ` svnversion -nc | / usr / bin / sed -e 's/^[^:]*://;s/[A-Za-z]//' ` APPVERSION = `/ usr / libexec / PlistBuddy -c "Print CFBundleVersion" " ${TARGET_BUILD_DIR} " / ${INFOPLIST_PATH} ` xported = "xported" if [ $APPVERSION ! = $xported ] ; then / usr / libexec / PlistBuddy -c "Delete :CFBundleDisplayVersion" " ${TARGET_BUILD_DIR} " / ${INFOPLIST_PATH} / usr / libexec / PlistBuddy -c "Add :CFBundleDisplayVersion string" " ${TARGET_BUILD_DIR} " / ${INFOPLIST_PATH} / usr / libexec / PlistBuddy -c "Set :CFBundleDisplayVersion $APPVERSION . $REVISION " " ${TARGET_BUILD_DIR} " / ${INFOPLIST_PATH} fi Чтоб добавить скрипт, необходимо выполнить следующие действия: 1. Зажать Ctrl+клик на фаил проекта в дереве проекта 2. Add->New Build Phase -> New Run Script Build Phase 3. Откроется окно в которое нужно вставить скрипт. [Read more...] Tags: Apple , iOS , iPad , iPhone , Mac OS X , RegExp , SVN , xCode , Кодинг One Comment ( 2 votes, average: 5.00 out of 5) Loading ... Keychain Categories: Apple , Mac OS X , iPhone on Jan.28, 2011 Это только часть статьи, скопировал с habrahabr.ru. Добавил для себя, но может кому-то пригодится тоже. Спасибо автору youROCK. Функции для работы с Keychain достаточно низкоуровневые (в отличие от большинства фреймворков, которые работают с пользовательским интерфейсом), и используют API на языке C. В документации от Apple есть очень объемное руководство по всем вызовам, которые поддерживаются подсистемой Keychain Services, но я бы хотел показать, насколько просто можно делать базовые вещи. При работе с вызовами на языке C, Apple в основном использует CoreFoundation. CoreFoundation использует и поддерживает практически те же самые типы данных, которые используются в Objective C с фреймворком Cocoa, и даже поддерживает прозрачное приведение типов CoreFoundation < -> Cocoa. Все вызовы CoreFoundation имеют префикс CF (ср. с NS), а имена типов получаются с помощью замены NS на CF и звездочки [*] на суффикс Ref (reference, ссылка) в конец (к примеру, NSString* < -> CFStringRef, NSArray* < -> CFArrayRef). Для работы с памятью используются CFRelease(CFTypeRef) / CFRetain(CFTypeRef), о назначении и способе использования которых можете догадаться сами. [Read more...] Tags: Apple , iOS , iPad , Keychain , Mac OS X , objective-c , Кодинг One Comment ( 1 votes, average: 5.00 out of 5) Loading ... iPad TV ad Categories: Apple , iPad on Jan.21, 2011 Новая реклама iPad. В рекламе есть приложение созданное нашей командой :) Tags: ad , Apple , iPad One Comment ( 2 votes, average: 5.00 out of 5) Loading ... Small feature with UIlabel Categories: Apple , iPad , iPhone on Jan.15, 2011 Add framework QuartzCore 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 #import UILabel * label = [ [ UILabel alloc ] init ] ; [ label setTextColor : [ UIColor whiteColor ] ] ; [ label setBackgroundColor : [ UIColor darkGrayColor ] ] ; [ [ label layer ] setBorderWidth : 2 ] ; [ [ label layer ] setCornerRadius : 15 ] ; [ [ label layer ] setBorderColor : [ UIColor whiteColor ] .CGColor ] ; [ label setAlpha : 0.8 ] ; [ label setTextAlignment : UITextAlignmentCenter ] ; [ label setFrame : CGRectMake ( 0 , 0 , 220 , 50 ) ] ; [ label setText : @ "Loading..." ] ; [ label setCenter : window.center ] ; [ window addSubview : label ] ; Result: Tags: Apple , iOS , objective-c , QuartzCore , UI , UIImage , UIKit Leave a Comment ( 1 votes, average: 5.00 out of 5) Loading ... Restoring playlists from iPhone/iPad for iTunes Categories: Mac OS X , iPad , iPhone on Nov.24, 2010 Возникла проблема после обновления Mac OS X и iTunes. Поломалась база iTunes и плейлисты были утеряны. Но часть плейлистов осталась на iPhone! И их то мы и востановим. [Read more...] Tags: iPad , iPhone , iTunes , Mac OS X , Music Leave a Comment (No Ratings Yet) Loading ... Integrate High Scores service of mob1serv Categories: Apple , Mob1serv , OOP , iPad , iPhone , others on Nov.08, 2010 Для начала нужно немного ознакомиться на сайте mob1serv как это работает. Скачать либу с сайта или которую собрал я , немного модифицированную, добавил пару расширений. В мой версии также вложен пример с сайта mob1serv. Начнем… 1. Нам нужно проверить интернет соединение, лучше всего воспользоваться Reachability , уже готовым решением от разработчиков Apple. На этом моменте останавливаться не будем, в примере все показано. 2. Перед тем как мы будем работать непосредственно с API либы, продемострирую как ее подключить к проекту [Read more...] Tags: iOS , iPad , iPhone , Mob1serv , objective-c , OOP , XML Leave a Comment ( 2 votes, average: 5.00 out of 5) Loading ... Page 1 of 16 1 2 3 4 5 » ... Last » Feedburn & Twitter Google Search on Site Custom Search Blog of www.mob1serv.com After Seedcamp: still on crack :) Mob1serv starts 2011 with.. Seedcamp! Mob1serv HighScores module grows more popular Ratings Create 3d earth for SIO2 project Баланс на Webmoney? Спросим у PHP! UML диаграммы в Xcode How to Add Speed Dial Icons to iPhone’s Home Screen Simple XML Parser based on NSXMLParser +converter UIImage and Memory iPhone samples code Spin UI Object, animation rotate 360 Degree Streatch image with stretchableImageWithLeftCapWidth: topCapHeight: Yandex тИЦ в статус баре FireFox`a Highest rated files (iPhone Samples code) OpenGL GIF Player Apple iPhone samples code Rewrite UITabBar UICatalog all UI of iPhone Latest Posts Setting the text color of an NSButton Вакансии Injoit Ltd How to include ttf fonts to iOS app Основы Grand Central Dispatch Adding SVN revision to Xcode project Keychain iPad TV ad Small feature with UIlabel Restoring playlists from iPhone/iPad for iTunes Integrate High Scores service of mob1serv Tags AJAX Android Apple Blender Book Chrome FireFox Google iOS iPad iPhone Jailbreak Javascript jQuery life Linux Mac Mac OS X Macros Mob1serv objective-c OOP OpenGL OS PHP Private Python QA RegExp SIO2 SVN Texture Trac UI UIFont UIImage UIKit UITabBar UIWebView Ukraine Wordpress work xCode XML Кодинг Ads from Google for hosting ;) Categories Android Apple iPad iPhone Mac OS X FireFox Google Javascript jQuery Linux Mob1serv Money OOP others PHP Wordpress Python Trac Tutorials For users Log in Blogs of friends :) mob1serv: universal web service for iPhone / Android Injoit: iPhone / Android development, London, UK SoftWare For Mac OS X Дао человека с кошкой Taras Filatov Alex Bulgakov Archive April 2011 February 2011 January 2011 November 2010 October 2010 September 2010 June 2010 May 2010 April 2010 March 2010 February 2010 January 2010 December 2009 November 2009 October 2009 September 2009 August 2009 July 2009 June 2009 May 2009 April 2009 March 2009 February 2009 January 2009 December 2008 November 2008 October 2008 September 2008 April 2008 Ads Заработать Donate Z286920228019 U225679933128 R153748891142 money for , i have 0,1 % Ads from Google Powered by SAKrisT