iphone Programming Glossary: runtime.h
Objective-C Category and new iVar http://stackoverflow.com/questions/10502539/objective-c-category-and-new-ivar SoundChainHelper @property nonatomic retain NSMutableArray soundsInChain @end In your .m #import objc runtime.h static char soundsInChainKey @implementation SimpleAudioEngine SoundChainHelper NSMutableArray soundsInChain return objc_getAssociatedObject..
Method Swizzle on iPhone device http://stackoverflow.com/questions/1637604/method-swizzle-on-iphone-device on method swizzling here . Mike Ash has a relatively simple implementation at the bottom of that page #import objc runtime.h #import objc message.h .... void Swizzle Class c SEL orig SEL new Method origMethod class_getInstanceMethod c orig Method..
objc_setAssociatedObject unavailable in iPhone simulator http://stackoverflow.com/questions/1916130/objc-setassociatedobject-unavailable-in-iphone-simulator this question A quick and dirty workaround largely untested may be buggy #if TARGET_IPHONE_SIMULATOR #import objc runtime.h enum OBJC_ASSOCIATION_ASSIGN 0 OBJC_ASSOCIATION_RETAIN_NONATOMIC 1 OBJC_ASSOCIATION_COPY_NONATOMIC 3 OBJC_ASSOCIATION_RETAIN..
Dismissing UIAlertViews when entering background state http://stackoverflow.com/questions/3105974/dismissing-uialertviews-when-entering-background-state then to avoid multiple registrations to the notification center. #import UIAlertViewAutoDismiss.h #import objc runtime.h @interface UIAlertViewAutoDismiss UIAlertViewDelegate id UIAlertViewDelegate __unsafe_unretained privateDelegate @end @implementation..
how to get selected text from uitextfield in iphone? http://stackoverflow.com/questions/5230297/how-to-get-selected-text-from-uitextfield-in-iphone . MyTextField.h #import UIKit UIKit.h @interface MyTextField UITextField @end MyTextField.m #import objc runtime.h #import MyTextField.h UIKIT_STATIC_INLINE void mySelectionDidChange id self SEL _cmd id UITextInput textInput @implementation..
Subclass UIButton to add a property http://stackoverflow.com/questions/5500327/subclass-uibutton-to-add-a-property @property nonatomic retain NSObject property @end UIButton Property.m #import UIButton Property.h #import objc runtime.h @implementation UIButton Property static char UIB_PROPERTY_KEY @dynamic property void setProperty NSObject property objc_setAssociatedObject..
error: /usr/include/objc/objc-class.h: No such file or directory http://stackoverflow.com/questions/6344131/error-usr-include-objc-objc-class-h-no-such-file-or-directory
iPhone - ShareKit , SHK.m giving the compiler error for FileNot Found http://stackoverflow.com/questions/8310512/iphone-sharekit-shk-m-giving-the-compiler-error-for-filenot-found
Objective-C 2.0: class_copyPropertyList(), how to list properties from categories http://stackoverflow.com/questions/848636/objective-c-2-0-class-copypropertylist-how-to-list-properties-from-categorie the public headers a little quicker. For reference here's my test project #import Foundation Foundation.h #import objc runtime.h @interface TestClass NSObject NSString str1 NSString str2 @property nonatomic copy NSString str1 @end @interface TestClass..
Loop through all object properties at runtime http://stackoverflow.com/questions/9269372/loop-through-all-object-properties-at-runtime API to loop through and print information about each property in a class #import Foundation Foundation.h #import objc runtime.h @interface TestClass NSObject @property nonatomic retain NSString firstName @property nonatomic retain NSString lastName..
iOS4 Implementation of -[NSURLConnection sendAsynchronousRequest:queue:completionHandler:]? http://stackoverflow.com/questions/9829653/ios4-implementation-of-nsurlconnection-sendasynchronousrequestqueuecompletio queue completionHandler for iOS 5 #if __IPHONE_OS_VERSION_MIN_REQUIRED __IPHONE_5_0 #import objc runtime.h #import NSURLConnection iOS4.h Dynamically add NSURLConnection sendAsynchronousRequest queue completionHandler . void sendAsynchronousRequest4.. correctly Should we copy them if handler queue addOperationWithBlock ^ handler response data nil @end #import objc runtime.h #import NSURLConnection SendAsync.h Dynamically add @property nonatomic readonly UIViewController presentingViewController...
|