Рубрика: ‘Mac OS X’
Рубрики: iPad, iPhone, Mac OS X on Dec.17, 2011
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 [...]
Теги: AudioSessionAddPropertyListener, AudioToolbox, iPhone, kAudioSessionProperty_AudioRouteChange
Рубрики: iPad, iPhone, Mac OS X on Oct.22, 2011
Sorting by block 12345678910111213141516171819NSArray *stringsArray = [NSArray arrayWithObjects: @"string 1", @"String 21", [...]
Теги: iOS, objective-c, sort, __block
Рубрики: iPad, iPhone, Mac OS X on Oct.22, 2011
Doc about font metric Getting Font Metrics
Теги: iOS, UIFont
Рубрики: Mac OS X on Aug.18, 2011
Little application for getting geo location from photo
Теги: Apple, Application, Geo, Image, Mac, Mac OS X, Map, objective-c, OOP, Position, Tag, Ukraine
Рубрики: Mac OS X on Aug.17, 2011
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, [...]
Теги: Authorization, objective-c, OS X, sudo
Рубрики: Mac OS X on Jul.16, 2011
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 [...]
Теги: AttachedWindow, Mac OS X, NSWindow, OS X
Рубрики: Mac OS X, others on Jul.14, 2011
Custom message box on Cocoa, like iOS messsge bubbles!
Теги: Mac OS X, NSGraphicsContext, NSView, objective-c, OS X
Рубрики: 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: 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]; [...]
Теги: Mac OS X, NSButton, NSColor, NSMutableAttributedString, objective-c
Рубрики: Apple, iPhone, Mac OS X on Apr.08, 2011
В предыдущих статьях писал, что хотел перевести одну интересную статью с английского, но вот нашел перевод хорошей статьи на русский. Думаю автор перевода не будет против если я копию возьму себе :) Что это? Grand Central Dispatch, или, коротко, GCD — это низкоуровневое API, которая открывает новый способ работать с параллельными (оригинально это concurrent, а не [...]
Теги: GCD, iOS, iPad, iPhone, Mac OS X, objective-c, OOP, Кодинг