This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// TestClass.h | |
#import <Foundation/Foundation.h> | |
@protocol TestProtocol <NSObject> | |
@optional | |
- (void) testProtocolMethod; | |
@end | |
@interface TestClass: NSObject | |
{ | |
// Struct that will hold the methods that the delegate implements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#if __has_attribute(objc_requires_super) | |
#define NS_REQUIRES_SUPER __attribute((objc_requires_super)) | |
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Q: What’s wrong with this code? | |
NSLock* arrayLock = GetArrayLock(); | |
NSMutableArray* myArray = GetSharedArray(); | |
id anObject; | |
[arrayLock lock]; | |
anObject = [myArray objectAtIndex:0]; | |
[arrayLock unlock]; |
OlderNewer