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
PFQuery *query = [PFQuery queryWithClassName:@"ParseClassName"]; | |
[query findObjectsInBackgroundWithBlock:^(NSArray *objects, NSError *error) { | |
NSLog(@"%@", objects); | |
}]; |
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
function printMethods(className) { | |
var count = new new Type("I"); | |
var methods = class_copyMethodList(objc_getClass(className), count); | |
var methodsArray = []; | |
for(var i = 0; i < *count; i++) { | |
var method = methods[i]; | |
methodsArray.push({selector:method_getName(method), implementation:method_getImplementation(method)}); | |
} | |
free(methods); | |
free(count); |
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
ZBarImageScanner *scanner = _viewPreview.scanner; | |
[scanner setSymbology: ZBAR_I25 | |
config: ZBAR_CFG_ENABLE | |
to: 0]; | |
[scanner setSymbology: ZBAR_QRCODE | |
config: ZBAR_CFG_Y_DENSITY | |
to: 1]; | |
[scanner setSymbology: ZBAR_QRCODE | |
config: ZBAR_CFG_X_DENSITY | |
to: 1]; |
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
@property (strong, nonatomic) NSNumber* cellZoomXScaleFactor; | |
@property (strong, nonatomic) NSNumber* cellZoomYScaleFactor; | |
@property (strong, nonatomic) NSNumber* cellZoomXOffset; | |
@property (strong, nonatomic) NSNumber* cellZoomYOffset; | |
@property (strong, nonatomic) NSNumber* cellZoomInitialAlpha; | |
@property (strong, nonatomic) NSNumber* cellZoomAnimationDuration; |
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
NSString *newKey = @"NewPassKey"; | |
[database rekey:newKey]; |
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
- (FMDatabase *)openWriteableDatabase | |
{ | |
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *documentsDirectory = [paths objectAtIndex:0]; | |
NSString *writableDBPath = [documentsDirectory stringByAppendingPathComponent:@"encrypted.sqlite"]; | |
FMDatabase* database = [FMDatabase databaseWithPath:writableDBPath]; | |
[database open]; | |
NSString *key = @"PassKey"; | |
[database setKey:key]; |
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
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
{ | |
NSArray *documentPaths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES); | |
NSString *documentDir = [documentPaths objectAtIndex:0]; | |
self.databasePath = [documentDir stringByAppendingPathComponent:@"sqmple.sqlite"]; | |
[self createAndCheckDatabase]; | |
return YES; | |
} |
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
- (void) stopReading:(BroadcastTableViewCell *)cell | |
{ | |
if([_speechSynthesizer isSpeaking]) { | |
[_speechSynthesizer stopSpeakingAtBoundary:AVSpeechBoundaryImmediate]; | |
AVSpeechUtterance *utterance = [AVSpeechUtterance speechUtteranceWithString:@""]; | |
[_speechSynthesizer speakUtterance:utterance]; | |
[_speechSynthesizer stopSpeakingAtBoundary:AVSpeechBoundaryImmediate]; | |
} | |
cell.megaphoneButton.selected = NO; |
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
- (void) readCellText:(NSString *)text withCell:(BroadcastTableViewCell *)cell | |
{ | |
[self stopReading:cell]; | |
cell.megaphoneButton.selected = YES; | |
AVSpeechUtterance *utterance = [[AVSpeechUtterance alloc] initWithString:text]; | |
utterance.voice = [AVSpeechSynthesisVoice voiceWithLanguage:@"ru-RU"]; | |
NSUserDefaults *defaults = [NSUserDefaults standardUserDefaults]; |