-
Что такое
полиморфизм
? -
Что такое *инкапсуляция? Что такое *нарушение инкапсуляции?
-
Чем
абстрактный
класс отличается отинтерфейса
? -
Расскажите о
паттерне MVC
. Чем отличаетсяпассивная
модель отактивной
?
This file contains hidden or 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
// Case 1 | |
// A modifiable pointer to a constant NSString. | |
// | |
NSString* john = @"John"; | |
NSString* const userName1 = john; | |
//If we try like below - an error occurs because userName1 is a modifiable pointer to a constant NSString, so its value can't be modified | |
//userName1 = @"Not John"; // Invalid -> Read-only variable is not assignable |
This file contains hidden or 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
-(void) openReceiverApp | |
{ | |
UIApplication *ourApplication = [UIApplication sharedApplication]; | |
NSString *ourPath = @"RunKeeperPro://"; | |
NSURL *ourURL = [NSURL URLWithString:ourPath]; | |
if ([ourApplication canOpenURL:ourURL]) { | |
[ourApplication openURL:ourURL]; | |
} |
This file contains hidden or 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
- (void)enumerateObjectsUsingBlock:(void (^)(id obj, NSUInteger idx, BOOL *stop))block { | |
NSParameterAssert(block != NULL); | |
NSUInteger idx = 0; | |
for(id obj in self) { | |
BOOL stop = NO; | |
block(obj, idx++, &stop); |
This file contains hidden or 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
- (void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event | |
{ | |
for (UITouch *touch in touches) { | |
if (touch != nil) { | |
[self.hero flyWithYLimit:self.size.height]; | |
} | |
} | |
} |
This file contains hidden or 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
#pragma mark Singleton stuff | |
static id _sharedInstance; | |
+ (EKCoreDataProvider *)sharedInstance | |
{ | |
static dispatch_once_t onceToken; | |
dispatch_once(&onceToken, ^{ | |
_sharedInstance = [[EKCoreDataProvider alloc] init]; | |
}); |