Рубрика: ‘Mac OS X’

AudioSession AudioRouteChange

if you will use or used AVPlayer or you want just know about changes, you can check AudioRouteChange. Simple solution: Add framework AudioToolbox and add import to file 1#import <AudioToolbox/AudioToolbox.h> Insert into init method or any other 1AudioSessionAddPropertyListener (kAudioSessionProperty_AudioRouteChange, callbackHeadphone_func, self); Listener callback 12345678910111213141516171819202122232425void callbackHeadphone_func ( void *inClientData, AudioSessionPropertyID inID, UInt32 inDataSize, const void *inData [...]

Теги: , , ,

Комментарии отсутствуют

Sorting by block

Sorting by block 12345678910111213141516171819NSArray *stringsArray = [NSArray arrayWithObjects:                                  @"string 1",                                  @"String 21",                       [...]

Теги: , , ,

Комментарии отсутствуют

Getting Font Metrics

Doc about font metric Getting Font Metrics

Теги: ,

Комментарии отсутствуют

Get Geo tags from image

Little application for getting geo location from photo

Теги: , , , , , , , , , , ,

Комментарии отсутствуют

Administrator Privilege in Mac OS X app

If the Terminal command requires Administrator Privilege (aka sudo), use AuthorizationExecuteWithPrivileges instead. The following will create a file named “com.developers-life.test” is the root directory “/System/Library/Caches”. 123456789101112131415AuthorizationRef authorizationRef; FILE *pipe = NULL; OSStatus err = AuthorizationCreate(nil,                                    kAuthorizationEmptyEnvironment,     [...]

Теги: , , ,

Комментарии отсутствуют

Draw arrow on QuartzCore for iOS

Simple drawing arrow.

Теги: , , ,

Комментарий (1)

MAAttachedWindow from Matt Gemmell

Nice window! Thanks, Matt Legend Gemmell! I us it in my apps, good solution! :) A cool NSWindow subclass which lets you easily attach a view to another window, displayed in a floating “speech-bubble”-like borderless window. Very handy for contextual help, showing options for a certain control, or just to draw attention to things. Have [...]

Теги: , , ,

Комментарии отсутствуют

Custom message Box

Custom message box on Cocoa, like iOS messsge bubbles!

Теги: , , , ,

Комментарии отсутствуют

Setting the text color of an NSButton

Here’s a simple little category on NSButton which adds -textColor and -setTextColor: methods to the class. Header: 1234567#import <Cocoa/Cocoa.h> @interface NSButton (TextColor) – (NSColor *)textColor; – (void)setTextColor:(NSColor *)textColor; @end Implementation: 12345678910111213141516171819202122232425262728293031#import "NSButton+TextColor.h" @implementation NSButton (TextColor) – (NSColor *)textColor {     NSAttributedString *attrTitle = [self attributedTitle];     int len = [attrTitle length];     [...]

Теги: , , , ,

Комментарии отсутствуют

Основы Grand Central Dispatch

В предыдущих статьях писал, что хотел перевести одну интересную статью с английского, но вот нашел перевод  хорошей статьи на русский. Думаю автор перевода не будет против если я копию возьму себе :) Что это? Grand Central Dispatch, или, ко­рот­ко, GCD — это низ­ко­уров­не­вое API, ко­то­рая от­кры­ва­ет но­вый спо­соб ра­бо­тать с па­рал­лель­ны­ми (ори­ги­наль­но это concurrent, а не [...]

Теги: , , , , , , ,

Комментарии отсутствуют