92+ results for 'NSString lang:ObjectiveC' (0 ms)
Not the results you expected?
SimpleCLexer.m (https://bitbucket.org/rlyspn/androidrr.git) Objective C · 1160 lines
hadoopfs.m (https://github.com/hyunjung/hadoop-common.git) Objective C · 2160 lines
197 @implementation FileStatus
198 - (id) initWithPath: (NSString *) path length: (int64_t) length isdir: (BOOL) isdir block_replication: (int16_t) block_replication blocksize: (int64_t) blocksize modification_time: (int64_t) modification_time permission: (NSString *) permission owner: (NSString *) owner group: (NSString *) group
199 {
200 self = [super init];
415 case 1:
416 if (fieldType == TType_STRING) {
417 NSString * fieldValue = [inProtocol readString];
418 [self setPath: fieldValue];
419 } else {
471 case 8:
472 if (fieldType == TType_STRING) {
473 NSString * fieldValue = [inProtocol readString];
474 [self setOwner: fieldValue];
475 } else {
ForAndroid.m (https://gitlab.com/praveenvelanati/ios-demo) Objective C · 1603 lines
27 return @"ForAndroid";
28 }
29 - (xmlNodePtr)xmlNodeForDoc:(xmlDocPtr)doc elementName:(NSString *)elName elementNSPrefix:(NSString *)elNSPrefix
30 {
31 NSString *nodeName = nil;
186 xmlNsPtr elementNamespace = xmlSearchNs(cur->doc, cur, [prefix xmlString]);
188 NSString *standardPrefix = [[USGlobals sharedInstance].wsdlStandardNamespaces objectForKey:[NSString stringWithCString:(char*)elementNamespace->href encoding:NSUTF8StringEncoding]];
190 elementClassString = [NSString stringWithFormat:@"%@_%@", standardPrefix, localName];
781 return @"ForAndroid";
782 }
783 - (xmlNodePtr)xmlNodeForDoc:(xmlDocPtr)doc elementName:(NSString *)elName elementNSPrefix:(NSString *)elNSPrefix
784 {
785 NSString *nodeName = nil;
ImageNameTest.m (https://gitlab.com/boxnia/NFU_MOVIL) Objective C · 702 lines
36 // expose private interface
37 - (NSString*)getImageName:(UIInterfaceOrientation)currentOrientation delegate:(id<CDVScreenOrientationDelegate>)orientationDelegate device:(CDV_iOSDevice)device;
39 @end
55 - (void) orientationHelper:(id<CDVScreenOrientationDelegate>)delegate expectedImageNameDictionary:(NSDictionary*)expectedImageNameDictionary device:(CDV_iOSDevice)device{
57 NSString* name = nil;
58 NSString* expectedImageName = nil;
59 UIInterfaceOrientation currentOrientation;
60 NSString* deviceName = device.iPad? @"iPad" : device.iPhone6Plus? @"iPhone6Plus": device.iPhone6? @"iPhone6": device.iPhone5? @"iPhone5" : @"iPhone";
62 // LandscapeLeft, should always return expectedImageName
GRMustacheNSFormatterTest.m (https://github.com/oleganza/GRMustache.git) Objective C · 381 lines
41 // test filtering a number
42 id data = @{ @"number": number, @"percent": percentFormatter };
43 NSString *rendering = [GRMustacheTemplate renderObject:data
44 fromString:@"{{ percent(number) }}"
45 error:NULL];
55 // test that string is unprocessable
56 NSString *unprocessableValue = @"foo";
57 STAssertNil([percentFormatter stringForObjectValue:unprocessableValue], @"");
59 // test filtering a string
60 id data = @{ @"value": unprocessableValue, @"percent": percentFormatter };
61 NSString *rendering = [GRMustacheTemplate renderObject:data
62 fromString:@"{{ percent(value) }}"
63 error:NULL];
GRMustacheConfigurationTest.m (https://github.com/oleganza/GRMustache.git) Objective C · 426 lines
72 [GRMustacheConfiguration defaultConfiguration].contentType = GRMustacheContentTypeHTML;
73 GRMustacheTemplate *template = [GRMustacheTemplate templateFromString:@"{{subject}}" error:NULL];
74 NSString *rendering = [template renderObject:@{@"subject":@"&"} error:NULL];
75 STAssertEqualObjects(rendering, @"&", @"");
76 }
80 [GRMustacheConfiguration defaultConfiguration].contentType = GRMustacheContentTypeText;
81 GRMustacheTemplate *template = [GRMustacheTemplate templateFromString:@"{{subject}}" error:NULL];
82 NSString *rendering = [template renderObject:@{@"subject":@"&"} error:NULL];
83 STAssertEqualObjects(rendering, @"&", @"");
84 }
98 __block BOOL testedHTMLSafeDefined = NO;
99 __block BOOL testedHTMLSafe = NO;
100 id object = [GRMustache renderingObjectWithBlock:^NSString *(GRMustacheTag *tag, GRMustacheContext *context, BOOL *HTMLSafe, NSError **error) {
101 NSString *rendering = [testedTemplate renderContentWithContext:context HTMLSafe:HTMLSafe error:error];
124 __block BOOL testedHTMLSafeDefined = NO;
125 __block BOOL testedHTMLSafe = NO;
126 id object = [GRMustache renderingObjectWithBlock:^NSString *(GRMustacheTag *tag, GRMustacheContext *context, BOOL *HTMLSafe, NSError **error) {
127 NSString *rendering = [testedTemplate renderContentWithContext:context HTMLSafe:HTMLSafe error:error];
GRMustacheTemplateFromMethodsTest.m (https://github.com/oleganza/GRMustache.git) Objective C · 400 lines
70 - (NSString *)templatePath { return [self.templateURL path]; }
71 - (NSString *)templateString { return [NSString stringWithContentsOfFile:self.templatePath encoding:NSUTF8StringEncoding error:NULL]; }
73 - (NSString *)parserErrorTemplateName { return @"GRMustacheTemplateFromMethodsTest_parserError"; }
91 - (NSString *)compilerErrorTemplateWrapperString { return [NSString stringWithContentsOfFile:self.compilerErrorTemplateWrapperPath encoding:NSUTF8StringEncoding error:NULL]; }
93 - (id)valueForKey:(NSString *)key inRendering:(NSString *)rendering
94 {
95 NSError *error;
101 }
103 - (NSString *)valueForStringPropertyInRendering:(NSString *)rendering
104 {
105 return [self valueForKey:@"stringProperty" inRendering:rendering];
106 }
108 - (NSString *)extensionOfTemplateFileInRendering:(NSString *)rendering
109 {
110 NSString *fileName = [self valueForKey:@"fileName" inRendering:rendering];
GRMustacheTagDelegateTest.m (https://github.com/oleganza/GRMustache.git) Objective C · 830 lines
52 __block BOOL success = YES;
53 delegate.mustacheTagDidRenderBlock = ^(GRMustacheTag *tag, id object, NSString *rendering) {
54 success = NO;
55 };
75 return @"delegate";
76 };
77 delegate.mustacheTagDidRenderBlock = ^(GRMustacheTag *tag, id object, NSString *rendering) {
78 postRenderedObjet = object;
79 postRenderingTagType = tag.type;
82 GRMustacheTemplate *template = [GRMustacheTemplate templateFromString:@"---{{foo}}---" error:NULL];
83 template.baseContext = [template.baseContext contextByAddingTagDelegate:delegate];
84 NSString *rendering = [template renderObject:@{@"foo": @"value"} error:NULL];
86 STAssertEqualObjects(rendering, @"---delegate---", @"");
GRMustacheRenderingObjectTest.m (https://github.com/oleganza/GRMustache.git) Objective C · 757 lines
29 @interface GRMustacheAttributedSectionTagHelper : NSObject<GRMustacheRendering> {
30 NSString *_attribute;
31 }
32 @property (nonatomic, copy) NSString *attribute;
40 [super dealloc];
41 }
42 - (NSString *)renderForMustacheTag:(GRMustacheTag *)tag context:(GRMustacheContext *)context HTMLSafe:(BOOL *)HTMLSafe error:(NSError **)error
43 {
44 GRMustacheTemplate *template = [tag.templateRepository templateFromString:@"attribute:{{attribute}}" error:NULL];
51 - (void)testRenderingObjectPerformsVariableRendering
52 {
53 id object = [GRMustache renderingObjectWithBlock:^NSString *(GRMustacheTag *tag, GRMustacheContext *context, BOOL *HTMLSafe, NSError **error) {
54 return @"---";
55 }];
GRBooleanTest.m (https://github.com/oleganza/GRMustache.git) Objective C · 356 lines
80 - (BOOL)booleanInterpretationForKey:(NSString *)key inObject:(id)object
81 {
82 NSString *templateString = [NSString stringWithFormat:@"{{#%@}}YES{{/%@}}{{^%@}}NO{{/%@}}", key, key, key, key];
83 GRMustacheTemplate *template = [GRMustacheTemplate templateFromString:templateString error:NULL];
84 NSString *result = [template renderObject:object error:NULL];
103 {
104 NSDictionary *context = object ? [NSDictionary dictionaryWithObject:object forKey:@"bool"] : [NSDictionary dictionary];
105 NSString *result = [[GRMustacheTemplate templateFromString:@"<{{bool}}>" error:NULL] renderObject:context error:NULL];
106 if ([result isEqualToString:@"<>"]) {
107 return NO;
MNWSProvider.m (https://github.com/PPUA/PlayPhoneSDKDemoIOS.git) Objective C · 1136 lines
11 @interface MNWSRequestContent()
12 -(NSString*) addCurrUserSubscriptionStatusForSnId:(NSInteger) snId;
13 @end
21 @interface MNWSInfoRequestResult()
22 -(void) setError:(NSString*) errorMessage;
23 @end
65 }
67 -(void) setError:(NSString*) errorMessage {
68 _failed = YES;
69 [_errorMessage release];
GTMValidatingContainersTest.m (https://github.com/chuckprice/objectiveresource.git) Objective C · 378 lines
GTMRegexTest.m (https://github.com/chuckprice/objectiveresource.git) Objective C · 1216 lines
31 @end
33 @interface NSString_GTMRegexAdditions : GTMTestCase
34 @end
139 - (void)testOptions {
141 NSString *testString = @"aaa AAA\nbbb BBB\n aaa aAa\n bbb BbB";
143 // default options
908 @end
910 @implementation NSString_GTMRegexAdditions
911 // Only partial tests to test that the call get through correctly since the
912 // above really tests them.
GTMBase64Test.m (https://github.com/chuckprice/objectiveresource.git) Objective C · 437 lines
77 // Bytes to String and back
78 NSString *encodedString = [GTMBase64 stringByEncodingBytes:[data bytes]
79 length:[data length]];
80 STAssertEquals(([encodedString length] % 4), (NSUInteger)0,
123 // Bytes to String and back
124 NSString *encodedString = [GTMBase64 stringByEncodingBytes:[data bytes]
125 length:[data length]];
126 STAssertEquals(([encodedString length] % 4), (NSUInteger)0,
374 - (void)testErrors {
375 const int something = 0;
376 NSString *nonAscString = [NSString stringWithUTF8String:"This test ©™®๒०᠐٧"];
378 STAssertNil([GTMBase64 encodeData:nil], @"it worked?");
NSObject+KiwiStubAdditions.m (https://bitbucket.org/kumaranvram/ios-bootcamp.git) Objective C · 245 lines
13 #import "KWStub.h"
15 static NSString * const StubValueKey = @"StubValueKey";
16 static NSString * const StubSecondValueKey = @"StubSecondValueKey";
17 static NSString * const ChangeStubValueAfterTimesKey = @"ChangeStubValueAfterTimesKey";
19 @implementation NSObject(KiwiStubAdditions)
27 return signature;
29 NSString *encoding = KWEncodingForVoidMethod();
30 return [NSMethodSignature signatureWithObjCTypes:[encoding UTF8String]];
31 }
124 if ([self methodSignatureForSelector:aMessagePattern.selector] == nil) {
125 [NSException raise:@"KWStubException" format:@"cannot stub -%@ because no such method exists",
126 NSStringFromSelector(aMessagePattern.selector)];
127 }
IMClient2ServGroup.pb.m (https://gitlab.com/lisit1003/TTiOSClient) Objective C · 1617 lines
108 return [C2MGroupListReq builderWithPrototype:self];
109 }
110 - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent {
111 if (self.hasCmdId) {
112 [output appendFormat:@"%@%@: %@\n", indent, @"cmdId", [NSNumber numberWithInteger:self.cmdId]];
337 return [C2MGroupListRsp builderWithPrototype:self];
338 }
339 - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent {
340 if (self.hasCmdId) {
341 [output appendFormat:@"%@%@: %@\n", indent, @"cmdId", [NSNumber numberWithInteger:self.cmdId]];
344 [output appendFormat:@"%@%@ {\n", indent, @"groupInfoList"];
345 [element writeDescriptionTo:output
346 withIndent:[NSString stringWithFormat:@"%@ ", indent]];
347 [output appendFormat:@"%@}\n", indent];
348 }];
IMClient2ServFile.pb.m (https://gitlab.com/lisit1003/TTiOSClient) Objective C · 1725 lines
108 return [C2FHeartBeatReq builderWithPrototype:self];
109 }
110 - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent {
111 if (self.hasCmdId) {
112 [output appendFormat:@"%@%@: %@\n", indent, @"cmdId", [NSNumber numberWithInteger:self.cmdId]];
313 return [C2FHeartBeatRsp builderWithPrototype:self];
314 }
315 - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent {
316 if (self.hasCmdId) {
317 [output appendFormat:@"%@%@: %@\n", indent, @"cmdId", [NSNumber numberWithInteger:self.cmdId]];
434 @interface C2FFileLoginReq ()
435 @property SInt32 cmdId;
436 @property (strong) NSString* userId;
437 @property (strong) NSString* token;
556 return [C2FFileLoginReq builderWithPrototype:self];
557 }
558 - (void) writeDescriptionTo:(NSMutableString*) output withIndent:(NSString*) indent {
559 if (self.hasCmdId) {
560 [output appendFormat:@"%@%@: %@\n", indent, @"cmdId", [NSNumber numberWithInteger:self.cmdId]];
EaseActionsTest.m (https://github.com/mefistody/FlashToCocos2D.git) Objective C · 888 lines
11 static int sceneIdx=-1;
12 static NSString *transitions[] = {
13 @"SpriteEase",
14 @"SpriteEaseInOut",
43 sceneIdx++;
44 sceneIdx = sceneIdx % ( sizeof(transitions) / sizeof(transitions[0]) );
45 NSString *r = transitions[sceneIdx];
46 Class c = NSClassFromString(r);
47 return c;
53 if( sceneIdx < 0 )
54 sceneIdx = sizeof(transitions) / sizeof(transitions[0]) -1;
55 NSString *r = transitions[sceneIdx];
56 Class c = NSClassFromString(r);
57 return c;
GPUImageGaussianBlurFilter.m (https://gitlab.com/Mr.Tomato/VideoEffects) Objective C · 488 lines
12 #pragma mark Initialization and teardown
14 - (id)initWithFirstStageVertexShaderFromString:(NSString *)firstStageVertexShaderString firstStageFragmentShaderFromString:(NSString *)firstStageFragmentShaderString secondStageVertexShaderFromString:(NSString *)secondStageVertexShaderString secondStageFragmentShaderFromString:(NSString *)secondStageFragmentShaderString
15 {
16 if (!(self = [super initWithFirstStageVertexShaderFromString:firstStageVertexShaderString firstStageFragmentShaderFromString:firstStageFragmentShaderString secondStageVertexShaderFromString:secondStageVertexShaderString secondStageFragmentShaderFromString:secondStageFragmentShaderString]))
372 }
374 - (void)switchToVertexShader:(NSString *)newVertexShader fragmentShader:(NSString *)newFragmentShader;
375 {
376 runSynchronouslyOnVideoProcessingQueue(^{
385 if (![filterProgram link])
386 {
387 NSString *progLog = [filterProgram programLog];
388 NSLog(@"Program link log: %@", progLog);
389 NSString *fragLog = [filterProgram fragmentShaderLog];
GPUImageDilationFilter.m (https://gitlab.com/Mr.Tomato/VideoEffects) Objective C · 431 lines
3 @implementation GPUImageDilationFilter
5 NSString *const kGPUImageDilationRadiusOneVertexShaderString = SHADER_STRING
6 (
7 attribute vec4 position;
27 );
29 NSString *const kGPUImageDilationRadiusTwoVertexShaderString = SHADER_STRING
30 (
31 attribute vec4 position;
55 );
57 NSString *const kGPUImageDilationRadiusThreeVertexShaderString = SHADER_STRING
58 (
59 attribute vec4 position;
YapDatabaseHooksTransaction.m (https://gitlab.com/Mr.Tomato/MeituanDemo) Objective C · 442 lines
251 * and then loop over them in "chunks" which are readily processable for extensions.
252 **/
253 - (void)handleRemoveObjectsForKeys:(NSArray *)keys inCollection:(NSString *)collection withRowids:(NSArray *)rowids
254 {
255 if (parentConnection->parent->didRemoveObjects)
411 * and then loop over them in "chunks" which are readily processable for extensions.
412 **/
413 - (void)handleWillRemoveObjectsForKeys:(NSArray *)keys inCollection:(NSString *)collection withRowids:(NSArray *)rowids
414 {
415 if (parentConnection->parent->willRemoveObjects)
MSRestV1.m (https://github.com/heatxsink/myspace-iphone-sdk.git) Objective C · 520 lines
165 friendsList = [friendsList substringToIndex:[friendsList length] - 1];
167 NSString *urlString = [NSString stringWithFormat:MS_V1_FRIENDSHIP, [NSString stringWithFormat: @"%d", userId],
168 friendsList];
169 return [self makeRawV1Request:urlString queryParameters:nil requestMethod:@"GET" requestBody:nil contentType:nil];
380 }
382 - (void) sendNotification: (NSInteger) appId recipients: (NSArray*) recipients content: (NSString*) content button0Surface:(NSString*) button0Surface button0Label:(NSString*) button0Label button1Surface:(NSString*) button1Surface button1Label:(NSString*) button1Label mediaItem: (NSString*) mediaItem
383 {
387 #pragma mark --Activities--
389 - (NSString*) getActivities:(NSString*) userId activityTypes:(NSString*)activityTypes extensions:(NSString*)extensions
390 composite:(NSString*)composite culture:(NSString*)culture datetime:(NSString*)dateTime pageSize:(NSString*)pageSize{
396 - (NSString*) getFriendActivities:(NSString*) userId activityTypes:(NSString*)activityTypes extensions:(NSString*)extensions
397 composite:(NSString*)composite culture:(NSString*)culture datetime:(NSString*)dateTime pageSize:(NSString*)pageSize{
398 NSString *urlString = [NSString stringWithFormat:MS_V1_FRIEND_ACTIVITIES, userId];
NSManagedObject+MagicalRecord.m (https://github.com/zipmark/MagicalRecord.git) Objective C · 675 lines
78 else
79 {
80 NSString *entityName = NSStringFromClass([self class]);
81 return [NSEntityDescription entityForName:entityName inManagedObjectContext:context];
82 }
576 }
578 + (NSArray *)findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending
579 {
580 return [self findByAttribute:attribute
594 else
595 {
596 NSString *entityName = NSStringFromClass([self class]);
597 return [NSEntityDescription insertNewObjectForEntityForName:entityName inManagedObjectContext:context];
598 }
NSManagedObject+MagicalFinders.m (https://bitbucket.org/sensicalapps/trybe.git) Objective C · 346 lines
194 }
196 + (NSArray *) MR_findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context
197 {
198 NSPredicate *searchTerm = [NSPredicate predicateWithFormat:@"%K = %@", attribute, searchValue];
220 + (NSFetchedResultsController *) MR_fetchController:(NSFetchRequest *)request delegate:(id<NSFetchedResultsControllerDelegate>)delegate useFileCache:(BOOL)useFileCache groupedBy:(NSString *)groupKeyPath inContext:(NSManagedObjectContext *)context
221 {
222 NSString *cacheName = useFileCache ? [NSString stringWithFormat:@"MagicalRecord-Cache-%@", NSStringFromClass([self class])] : nil;
224 NSFetchedResultsController *controller =
332 }
334 + (NSFetchedResultsController *) MR_fetchAllSortedBy:(NSString *)sortTerm ascending:(BOOL)ascending withPredicate:(NSPredicate *)searchTerm groupBy:(NSString *)groupingKeyPath delegate:(id<NSFetchedResultsControllerDelegate>)delegate
335 {
336 return [self MR_fetchAllSortedBy:sortTerm
GBObjectiveCParser-MethodsParsingTesting.m (https://github.com/SinnerSchraderMobileMirrors/appledoc.git) Objective C · 580 lines
38 GBStore *store = [[GBStore alloc] init];
39 // execute
40 [parser parseObjectsFromString:@"@interface MyClass -(id)method:(NSString*)var; @end" sourceFile:@"filename.h" toStore:store];
41 // verify
42 GBClassData *class = [[store classes] anyObject];
43 NSArray *methods = [[class methods] methods];
44 assertThatInteger([methods count], equalToInteger(1));
45 [self assertMethod:[methods objectAtIndex:0] matchesInstanceComponents:@"id", @"method", @"NSString", @"*", @"var", nil];
46 }
132 GBStore *store = [[GBStore alloc] init];
133 // execute
134 [parser parseObjectsFromString:@"@implementation MyClass -(id)method:(NSString*)var { } @end" sourceFile:@"filename.h" toStore:store];
135 // verify
136 GBClassData *class = [[store classes] anyObject];
GBCommentsProcessor-RegistrationsTesting.m (https://github.com/SinnerSchraderMobileMirrors/appledoc.git) Objective C · 510 lines
22 - (OCMockObject *)settingsProviderRepeatFirst:(BOOL)repeat;
23 - (void)assertFindCommentWithString:(NSString *)string matchesBlockRange:(NSRange)b shortRange:(NSRange)s;
25 @end
494 }
496 - (void)assertFindCommentWithString:(NSString *)string matchesBlockRange:(NSRange)b shortRange:(NSRange)s {
497 // setup
498 GBCommentsProcessor *processor = [GBCommentsProcessor processorWithSettingsProvider:[GBTestObjectsRegistry realSettingsProvider]];
GBCommentsProcessor-PreprocessingTesting.m (https://github.com/SinnerSchraderMobileMirrors/appledoc.git) Objective C · 631 lines
14 @interface GBCommentsProcessor (PrivateAPI)
15 - (NSString *)stringByPreprocessingString:(NSString *)string withFlags:(NSUInteger)flags;
16 - (NSString *)stringByConvertingCrossReferencesInString:(NSString *)string withFlags:(NSUInteger)flags;
37 GBCommentsProcessor *processor = [self defaultProcessor];
38 // execute
39 NSString *result1 = [processor stringByPreprocessingString:@"*bold1* *bold text* * bolder text *" withFlags:0];
40 NSString *result2 = [processor stringByPreprocessingString:@"*bold1* Middle *bold text*" withFlags:0];
48 GBCommentsProcessor *processor = [self defaultProcessor];
49 // execute
50 NSString *result1 = [processor stringByPreprocessingString:@"_bold1_ _bold text_ _ bolder text _" withFlags:0];
51 NSString *result2 = [processor stringByPreprocessingString:@"_bold1_ Middle _bold text_" withFlags:0];
59 GBCommentsProcessor *processor = [self defaultProcessor];
60 // execute
61 NSString *result = [processor stringByPreprocessingString:@"_*text1*_ *_marked text_* _* text2 *_" withFlags:0];
62 // verify
63 assertThat(result, is(@"_*text1*_ *_marked text_* _* text2 *_"));
DDXMLTesting.m (https://github.com/GunioRobot/iphone-dev-libraries.git) Objective C · 838 lines
59 + (void)testLocalName
60 {
61 NSLog(@"Starting %@...", NSStringFromSelector(_cmd));
63 NSString *nsTest1 = [NSXMLNode localNameForName:@"a:quack"];
64 NSString *ddTest1 = [DDXMLNode localNameForName:@"a:quack"];
66 NSAssert([nsTest1 isEqualToString:ddTest1], @"Failed test 1");
68 NSString *nsTest2 = [NSXMLNode localNameForName:@"a:a:quack"];
69 NSString *ddTest2 = [DDXMLNode localNameForName:@"a:a:quack"];
71 NSAssert([nsTest2 isEqualToString:ddTest2], @"Failed test 2");
73 NSString *nsTest3 = [NSXMLNode localNameForName:@"quack"];
74 NSString *ddTest3 = [DDXMLNode localNameForName:@"quack"];
TDPredicateEvaluator.m (https://github.com/livedo/fluidium.git) Objective C · 656 lines
9 #import "TDPredicateEvaluator.h"
10 #import "NSString+ParseKitAdditions.h"
12 // expr = term orTerm*
82 - (BOOL)evaluate:(NSString *)s {
83 PKAssembly *a = [PKTokenAssembly assemblyWithString:s];
84 return [[[self.exprParser completeMatchFor:a] pop] boolValue];
474 - (void)didMatchEqStringPredicate:(PKAssembly *)a {
475 NSString *value = [a pop];
476 NSString *attrKey = [a pop];
482 - (void)didMatchEqNumberPredicate:(PKAssembly *)a {
483 NSNumber *value = [a pop];
484 NSString *attrKey = [a pop];
485 BOOL yn = [value isEqualToNumber:[delegate valueForAttributeKey:attrKey]];
486 [a push:[NSNumber numberWithBool:yn]];
KSJSONTests.m (https://github.com/kstenerud/KSJSON.git) Objective C · 1112 lines
36 {
37 NSError* error = (NSError*)self;
38 NSString* expected = @"[]";
39 id original = [NSArray array];
40 NSString* jsonString = [KSJSON serializeObject:original error:&error];
797 }
799 NSString* expected = [NSString stringWithFormat:@"[\"%@\"]", string];
800 id original = [NSArray arrayWithObjects:
801 string,
817 memset(buff, '2', sizeof(buff));
818 buff[sizeof(buff)-1] = 0;
819 NSString* string = [NSString stringWithCString:buff encoding:NSUTF8StringEncoding];
821 id original = [NSArray arrayWithObjects:
HBAudio.m (https://github.com/shkolnik/HandBrake.git) Objective C · 708 lines
10 #import "hb.h"
12 NSString *keyAudioCodecName = @"keyAudioCodecName";
13 NSString *keyAudioMP4 = @"keyAudioMP4";
14 NSString *keyAudioMKV = @"keyAudioMKV";
15 NSString *keyAudioSampleRateName = @"keyAudioSampleRateName";
16 NSString *keyAudioBitrateName = @"keyAudioBitrateName";
17 NSString *keyAudioMustMatchTrack = @"keyAudioMustMatchTrack";
18 NSString *keyAudioMixdownName = @"keyAudioMixdownName";
20 NSString *keyAudioCodec = @"codec";
21 NSString *keyAudioMixdown = @"mixdown";
22 NSString *keyAudioSamplerate = @"samplerate";
BlackJackViewController.m (https://github.com/chao87/BlackJack.git) Objective C · 584 lines
210 //score.text = [score.text stringByAppendingString: [NSString stringWithFormat: @"%i", [guest handTotal]]];
211 NSString* guestTotal = [NSString stringWithFormat: @"%i", [guest handTotal]];
212 NSString* dealerTotal = [NSString stringWithFormat: @"%i", [dealer handTotal]];
214 NSString* result = [[NSString alloc] initWithString:@" Guest Total is: "];
215 result = [result stringByAppendingString:guestTotal];
216 result = [result stringByAppendingString:@" - Dealer total is: "];
BXThemes.m (https://github.com/alunbestor/Boxer.git) Objective C · 813 lines
15 @implementation NSObject (BXThemableExtensions)
17 + (NSString *) defaultThemeKey
18 {
19 return nil;
32 @implementation NSControl (BXThemedControls)
34 + (NSString *) defaultThemeKey
35 {
36 if ([[self cellClass] respondsToSelector: _cmd])
40 }
42 - (void) setThemeKey: (NSString *)key
43 {
44 if ([self.cell respondsToSelector: _cmd])
WeiboClient.m (https://github.com/tianyawy/WeiboSDK.git) Objective C · 664 lines
55 {
56 needAuth = YES;
57 NSString *path = [NSString stringWithFormat:@"statuses/friends_timeline.%@", API_FORMAT];
59 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
297 {
298 needAuth = YES;
299 NSString *path = [NSString stringWithFormat:@"trends/statuses.%@", API_FORMAT];
301 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithCapacity:0];
597 {
598 needAuth = YES;
599 NSString *path = [NSString stringWithFormat:@"statuses/upload.%@", API_FORMAT];
600 NSMutableDictionary *params = [NSMutableDictionary dictionaryWithObjectsAndKeys:
601 status, @"status",
EmojiDataSource.m (https://github.com/tianyawy/WeiboSDK.git) Objective C · 544 lines
14 @implementation EmojiDataSource
16 + (void)insertEmoji:(NSString *)_emoji phrase:(NSString *)_phrase forType:(NSString *)_type {
17 NSMutableArray *emojiList = [gEmojies objectForKey:_type];
18 if (emojiList == nil) {
37 }
39 + (NSMutableArray *)getEmojiNodes:(NSString *)_type {
40 NSMutableDictionary *_emojies = [EmojiDataSource emojies];
41 return [_emojies objectForKey:_type];
46 return gRecentEmojies;
47 }
48 NSString *filePath = [WeiboEngine getCurrentUserStoreagePath:@"recentEmojiNodes.db"];
49 NSMutableArray *_recentEmojies = [NSKeyedUnarchiver unarchiveObjectWithFile:filePath];
50 gRecentEmojies = [_recentEmojies retain];
DSAdmin.m (https://bitbucket.org/danielsantb/aula-datasnap-e-aurelius.git) Objective C · 719 lines
515 * @return result - Type on server: TJSONValue
516 */
517 -(TJSONValue *) ConsumeClientChannel: (NSString *) channelname withClientManagerId: (NSString *) clientmanagerid withCallbackId: (NSString *) callbackid withChannelNames: (NSString *) channelnames withSecurityToken: (NSString *) securitytoken withResponseData: (TJSONValue *) responsedata{
519 DSRESTCommand * cmd = [[self Connection ] CreateCommand];
544 * @return result - Type on server: TJSONValue
545 */
546 -(TJSONValue *) ConsumeClientChannelTimeout: (NSString *) channelname withClientManagerId: (NSString *) clientmanagerid withCallbackId: (NSString *) callbackid withChannelNames: (NSString *) channelnames withSecurityToken: (NSString *) securitytoken withTimeout: (long) timeout withResponseData: (TJSONValue *) responsedata{
548 DSRESTCommand * cmd = [[self Connection ] CreateCommand];
591 * @return result - Type on server: Boolean
592 */
593 -(bool) RegisterClientCallbackServer: (NSString *) channelid withCallbackId: (NSString *) callbackid withChannelNames: (NSString *) channelnames withSecurityToken: (NSString *) securitytoken{
595 DSRESTCommand * cmd = [[self Connection ] CreateCommand];
CCScale9Sprite.m (https://bitbucket.org/mfavis/fixierush.git) Objective C · 685 lines
84 }
86 - (id)initWithFile:(NSString *)file rect:(CGRect)rect capInsets:(CGRect)capInsets
87 {
88 NSAssert(file != nil, @"Invalid file for sprite");
93 }
95 + (id)spriteWithFile:(NSString *)file rect:(CGRect)rect capInsets:(CGRect)capInsets
96 {
97 return SAFE_ARC_AUTORELEASE([[self alloc] initWithFile:file rect:rect capInsets:capInsets]);
98 }
100 - (id)initWithFile:(NSString *)file rect:(CGRect)rect
101 {
102 NSAssert(file != nil, @"Invalid file for sprite");
TGToolbarButton.m (https://gitlab.com/iranjith4/Telegram) Objective C · 648 lines
TGConversation.m (https://gitlab.com/iranjith4/Telegram) Objective C · 791 lines
354 ptr += length;
356 participantsData.exportedChatInviteString = [[NSString alloc] initWithData:linkData encoding:NSUTF8StringEncoding];
357 }
673 for (int i = 0; i < 3; i++)
674 {
675 NSString *value = nil;
676 if (i == 0)
677 value = _chatPhotoSmall;
707 [data getBytes:valueBytes range:NSMakeRange(ptr, length)];
708 ptr += length;
709 NSString *value = [[NSString alloc] initWithBytesNoCopy:valueBytes length:length encoding:NSUTF8StringEncoding freeWhenDone:true];
711 if (i == 0)
PSKeyValueDecoder.m (https://gitlab.com/iranjith4/Telegram) Objective C · 599 lines
56 uint32_t stringLength = readLength(currentPtr);
58 NSString *string = [[NSString alloc] initWithBytes:*currentPtr length:stringLength encoding:NSUTF8StringEncoding];
59 (*currentPtr) += stringLength;
60 return string;
334 }
336 - (NSString *)decodeStringForKey:(NSString *)key
337 {
338 NSData *keyData = [key dataUsingEncoding:NSUTF8StringEncoding];
545 {
546 uint32_t keyLength = readLength(&self->_currentPtr);
547 NSString *key = [[NSString alloc] initWithBytes:self->_currentPtr length:keyLength encoding:NSUTF8StringEncoding];
548 self->_currentPtr += keyLength;
SQLiteDatabaseTest.m (https://gitlab.com/iranjith4/Parse-SDK-iOS-OSX) Objective C · 600 lines
ObjectSubclassingControllerTests.m (https://gitlab.com/iranjith4/Parse-SDK-iOS-OSX) Objective C · 422 lines
47 @implementation TestSubclass
49 + (NSString *)parseClassName {
50 return @"TestSubclass";
51 }
55 @implementation NotSubclass
57 + (NSString *)parseClassName {
58 return @"TestSubclass";
59 }
65 @dynamic primitiveProperty, objectProperty, relationProperty, ivarProperty, aCopyProperty, badProperty, badRelation;
67 + (NSString *)parseClassName {
68 return @"PropertySubclass";
69 }
ObjectPinTests.m (https://gitlab.com/iranjith4/Parse-SDK-iOS-OSX) Objective C · 540 lines
26 ///--------------------------------------
28 - (id)mockPinObjects:(NSArray *)objects withPinName:(NSString *)pinName error:(NSError *)error {
29 PFPinningObjectStore *store = PFStrictClassMock([PFPinningObjectStore class]);
30 [Parse _currentManager].coreManager.pinningObjectStore = store;
38 }
40 - (id)mockUnpinObjects:(NSArray *)objects withPinName:(NSString *)pinName error:(NSError *)error {
41 PFPinningObjectStore *store = PFStrictClassMock([PFPinningObjectStore class]);
42 [Parse _currentManager].coreManager.pinningObjectStore = store;
48 }
50 - (id)mockUnpinAllObjectsWithPinName:(NSString *)pinName error:(NSError *)error {
51 PFPinningObjectStore *store = PFStrictClassMock([PFPinningObjectStore class]);
52 [Parse _currentManager].coreManager.pinningObjectStore = store;
PFQueryUtilities.m (https://gitlab.com/iranjith4/Parse-SDK-iOS-OSX) Objective C · 536 lines
Chameleon_.m (https://gitlab.com/yangle1111/knoware) Objective C · 793 lines
91 + (void)setGlobalThemeUsingPrimaryColor:(UIColor *)primaryColor
92 withSecondaryColor:(UIColor *)secondaryColor
93 usingFontName:(NSString *)fontName
94 andContentStyle:(UIContentStyle)contentStyle {
197 + (void)customizeBarButtonItemWithPrimaryColor:(UIColor *)primaryColor
198 fontName:(NSString *)fontName
199 fontSize:(float)fontSize
200 contentStyle:(UIContentStyle)contentStyle {
365 + (void)customizeLabelWithPrimaryColor:(UIColor *)primaryColor
366 fontName:(NSString *)fontName
367 fontSize:(CGFloat)fontSize
368 withContentStyle:(UIContentStyle)contentStyle {
MySVN.m (https://gitlab.com/nilesh1883/svnx) Objective C · 791 lines
16 static id
17 makeTaskInfo (NSString* name, NSString* commmandPath, NSArray* arguments)
18 {
19 return [NSMutableDictionary dictionaryWithObjectsAndKeys:
20 name, @"name",
21 [NSString stringWithFormat: @"%@ %@",
22 commmandPath, [arguments componentsJoinedByString: @" "]], @"command",
23 nil];
713 //----------------------------------------------------------------------------------------
715 + (NSString*) cachePathForKey: (NSString*) key
716 {
717 static NSMutableDictionary* cacheDict; // this dictionary contains the cache
org_xmlvm_iphone_UITextField.m (https://github.com/avh4/xmlvm.git) Objective C · 980 lines
30 #import <UIKit/UITextField.h>
31 #import "org_xmlvm_iphone_UIControl.h"
32 #include "org_xmlvm_iphone_NSString.h"
824 //XMLVM_BEGIN_WRAPPER[org_xmlvm_iphone_UITextField_setText___java_lang_String]
825 XMLVM_VAR_THIZ;
826 XMLVM_VAR_NSString(text, n1);
828 thiz.text = text;
943 //XMLVM_BEGIN_WRAPPER[org_xmlvm_iphone_UITextField_setPlaceholder___java_lang_String]
944 XMLVM_VAR_THIZ;
945 XMLVM_VAR_NSString(text, n1);
947 thiz.placeholder = text;
org_xmlvm_iphone_UIButton.m (https://github.com/avh4/xmlvm.git) Objective C · 913 lines
29 //XMLVM_BEGIN_IMPLEMENTATION
30 #import <UIKit/UIKit.h>
31 #include "org_xmlvm_iphone_NSString.h"
33 void org_xmlvm_iphone_UIButton_INTERNAL_CONSTRUCTOR(JAVA_OBJECT me, NSObject* wrappedObjCObj)
38 static JAVA_OBJECT __WRAPPER_CREATOR(NSObject* obj)
39 {
40 NSString* name = NSStringFromClass([obj class]);
41 if ([obj class] == [UIButton class] || ([name isEqual:@"UIRoundedRectButton"])) {
42 JAVA_OBJECT jobj = __NEW_org_xmlvm_iphone_UIButton();
725 //XMLVM_BEGIN_WRAPPER[org_xmlvm_iphone_UIButton_setTitle___java_lang_String_int]
726 XMLVM_VAR_THIZ;
727 XMLVM_VAR_NSString(title, n1);
728 XMLVM_VAR_INT(state, n2);
CCScale9Sprite.m (https://bitbucket.org/imh2/ios-mostrar.git) Objective C · 650 lines
77 }
79 - (id)initWithFile:(NSString *)file rect:(CGRect)rect capInsets:(CGRect)capInsets
80 {
81 NSAssert(file != nil, @"Invalid file for sprite");
86 }
88 + (id)spriteWithFile:(NSString *)file rect:(CGRect)rect capInsets:(CGRect)capInsets
89 {
90 return [[[self alloc] initWithFile:file rect:rect capInsets:capInsets] autorelease];
91 }
93 - (id)initWithFile:(NSString *)file rect:(CGRect)rect
94 {
95 NSAssert(file != nil, @"Invalid file for sprite");
UserStore.m (https://github.com/Punnya/ShareKit_Posterous.git) Objective C · 1889 lines
40 #endif
42 - (id) initWithUserId: (EDAMUserID) userId shardId: (NSString *) shardId privilege: (int) privilege username: (NSString *) username
43 {
44 self = [super init];
696 }
698 - (void) setClientName: (NSString *) clientName {
699 [clientName retain];
700 [__clientName release];
981 #endif
983 - (id) initWithUsername: (NSString *) username password: (NSString *) password consumerKey: (NSString *) consumerKey consumerSecret: (NSString *) consumerSecret;
985 - (void) read: (id <TProtocol>) inProtocol;
NoteStore.m (https://github.com/Punnya/ShareKit_Posterous.git) Objective C · 1855 lines
169 - (void) read: (id <TProtocol>) inProtocol
170 {
171 NSString * fieldName;
172 int fieldType;
173 int fieldID;
249 }
251 - (NSString *) description {
252 NSMutableString * ms = [NSMutableString stringWithString: @"SyncState("];
253 [ms appendString: @"currentTime:"];
260 [ms appendFormat: @"%qi", __uploaded];
261 [ms appendString: @")"];
262 return [NSString stringWithString: ms];
263 }
registrar.m (https://bitbucket.org/blake_davidson/drivethroughsafari.git) Objective C · 1488 lines
275 } else {
276 char *str = mono_string_to_utf8 ((MonoString *) retval);
277 NSString *nsstr = [[NSString alloc] initWithUTF8String:str];
278 [nsstr autorelease];
279 mono_free (str);
347 } else {
348 char *str = mono_string_to_utf8 ((MonoString *) retval);
349 NSString *nsstr = [[NSString alloc] initWithUTF8String:str];
350 [nsstr autorelease];
351 mono_free (str);
394 } else {
395 char *str = mono_string_to_utf8 ((MonoString *) retval);
396 NSString *nsstr = [[NSString alloc] initWithUTF8String:str];
397 [nsstr autorelease];
398 mono_free (str);
TestVersionParsing.m (https://github.com/mutru/growl.git) Objective C · 540 lines
17 - (void) testParseTwoComponentSVNVersion {
18 struct Version version;
19 NSString *string = @"1.3svn1400";
20 STAssertTrue(parseVersionString(string, &version), @"Parse of %@ failed", string);
21 STAssertEquals(
42 - (void) testParseTwoComponentHgVersion {
43 struct Version version;
44 NSString *string = @"1.3hg1400";
45 STAssertTrue(parseVersionString(string, &version), @"Parse of %@ failed", string);
46 STAssertEquals(
67 - (void) testParseTwoComponentDevelopmentVersion {
68 struct Version version;
69 NSString *string = @"1.3d1";
70 STAssertTrue(parseVersionString(string, &version), @"Parse of %@ failed", string);
71 STAssertEquals(
TestVersionComparisonBetweenStringsConverting1_0To0_5.m (https://github.com/mutru/growl.git) Objective C · 257 lines
15 - (void) testSVNVersionNewerThanSVNVersion {
16 NSString *olderString = @"1.0svn1000", *newerString = @"1.0svn1009";
17 STAssertEquals(compareVersionStringsTranslating1_0To0_5(olderString, newerString), (CFComparisonResult)kCFCompareLessThan, @"Older (%@) must be less than newer (%@)", olderString, newerString);
18 STAssertEquals(compareVersionStringsTranslating1_0To0_5(newerString, olderString), (CFComparisonResult)kCFCompareGreaterThan, @"Newer (%@) must be greater than older (%@)", newerString, olderString);
24 }
25 - (void) testSVNVersionEqualToSVNVersion {
26 NSString *string = @"1.0svn1000";
27 STAssertEquals(compareVersionStringsTranslating1_0To0_5(string, string), (CFComparisonResult)kCFCompareEqualTo, @"Version string (%@) must be equal to itself", string);
29 //Version-equal, but not string-equal.
30 NSString *stringA = @"01.00svn01000";
31 NSString *stringB = @"1.0svn1000";
35 - (void) testDevelopmentVersionNewerThanDevelopmentVersion {
36 NSString *olderString = @"1.0d10", *newerString = @"1.0d19";
37 STAssertEquals(compareVersionStringsTranslating1_0To0_5(olderString, newerString), (CFComparisonResult)kCFCompareLessThan, @"Older (%@) must be less than newer (%@)", olderString, newerString);
38 STAssertEquals(compareVersionStringsTranslating1_0To0_5(newerString, olderString), (CFComparisonResult)kCFCompareGreaterThan, @"Newer (%@) must be greater than older (%@)", newerString, olderString);
TestVersionComparisonBetweenStrings.m (https://github.com/mutru/growl.git) Objective C · 238 lines
15 - (void) testSVNVersionNewerThanSVNVersion {
16 NSString *olderString = @"1.0svn1000", *newerString = @"1.0svn1009";
17 STAssertEquals(compareVersionStrings(olderString, newerString), (CFComparisonResult)kCFCompareLessThan, @"Older (%@) must be less than newer (%@)", olderString, newerString);
18 STAssertEquals(compareVersionStrings(newerString, olderString), (CFComparisonResult)kCFCompareGreaterThan, @"Newer (%@) must be greater than older (%@)", newerString, olderString);
24 }
25 - (void) testSVNVersionEqualToSVNVersion {
26 NSString *string = @"1.0svn1000";
27 STAssertEquals(compareVersionStrings(string, string), (CFComparisonResult)kCFCompareEqualTo, @"Version string (%@) must be equal to itself", string);
29 //Version-equal, but not string-equal.
30 NSString *stringA = @"01.00svn01000";
31 NSString *stringB = @"1.0svn1000";
35 - (void) testDevelopmentVersionNewerThanDevelopmentVersion {
36 NSString *olderString = @"1.0d10", *newerString = @"1.0d19";
37 STAssertEquals(compareVersionStrings(olderString, newerString), (CFComparisonResult)kCFCompareLessThan, @"Older (%@) must be less than newer (%@)", olderString, newerString);
38 STAssertEquals(compareVersionStrings(newerString, olderString), (CFComparisonResult)kCFCompareGreaterThan, @"Newer (%@) must be greater than older (%@)", newerString, olderString);
TestVersionComparison.m (https://github.com/mutru/growl.git) Objective C · 378 lines
15 - (void) testSVNVersionNewerThanSVNVersion {
16 struct Version older, newer;
17 NSString *olderString = @"1.0svn1000", *newerString = @"1.0svn1009";
18 STAssertTrue(parseVersionString(olderString, &older), @"Could not parse older version string (prerequisite for comparison test)");
19 STAssertTrue(parseVersionString(newerString, &newer), @"Could not parse newer version string (prerequisite for comparison test)");
32 - (void) testSVNVersionEqualToSVNVersion {
33 struct Version versionA, versionB;
34 NSString *string = @"1.0svn1000";
35 STAssertTrue(parseVersionString(string, &versionA), @"Could not parse version string (prerequisite for equality test)");
36 STAssertTrue(parseVersionString(string, &versionB), @"Could not parse version string (prerequisite for equality test)");
40 //Version-equal, but not string-equal.
41 NSString *stringA = @"01.00svn01000";
42 NSString *stringB = @"1.0svn1000";
49 - (void) testDevelopmentVersionNewerThanDevelopmentVersion {
50 struct Version older, newer;
51 NSString *olderString = @"1.0d10", *newerString = @"1.0d19";
52 STAssertTrue(parseVersionString(olderString, &older), @"Could not parse older version string (prerequisite for comparison test)");
53 STAssertTrue(parseVersionString(newerString, &newer), @"Could not parse newer version string (prerequisite for comparison test)");
AFNetworkingQueue.m (https://gitlab.com/pqhuy1987/Mahaikum) Objective C · 431 lines
46 } failure:^(AFHTTPRequestOperation *operation, NSError *error) {
47 NSString *tStr=[NSString stringWithFormat:@"-%@",_tag];
48 NSDictionary* dict = [NSDictionary dictionaryWithObject: operation forKey:@"index"];
49 [[NSNotificationCenter defaultCenter] postNotificationName:tStr object:self userInfo:dict];
137 }
139 -(void)uploadImageDrawing :(NSString *)requestUrl :(NSString *)_tag :(NSDictionary *)params :(NSData *)imageData {
140 NSURL *baseURL = [NSURL URLWithString:requestUrl];
239 }
241 -(void)uploadImageAndDataViaPUTPost :(NSString *)requestUrl :(NSString *)_tag :(NSDictionary *)params :(NSData *)imageData {
242 NSURL *baseURL = [NSURL URLWithString:requestUrl];
Chameleon_.m (https://gitlab.com/pqhuy1987/Mahaikum) Objective C · 756 lines
88 + (void)setGlobalThemeUsingPrimaryColor:(UIColor *)primaryColor
89 withSecondaryColor:(UIColor *)secondaryColor
90 usingFontName:(NSString *)fontName
91 andContentStyle:(UIContentStyle)contentStyle {
194 + (void)customizeBarButtonItemWithPrimaryColor:(UIColor *)primaryColor
195 fontName:(NSString *)fontName
196 fontSize:(float)fontSize
197 contentStyle:(UIContentStyle)contentStyle {
328 + (void)customizeLabelWithPrimaryColor:(UIColor *)primaryColor
329 fontName:(NSString *)fontName
330 fontSize:(CGFloat)fontSize
331 withContentStyle:(UIContentStyle)contentStyle {
ZXDataMatrixVersion.m (https://gitlab.com/OtherGroup/shadowsocks-iOS) Objective C · 350 lines
SmallPixelFont.m (https://github.com/initials/FlxiOSTilemap.git) Objective C · 421 lines
15 {
16 if (self == [SmallPixelFont class] && flixelFont == nil) {
17 NSString * fontPath = [NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] resourcePath], @"small_pixel.ttf"];
18 //[[NSBundle mainBundle] pathForResource:@"Flixel" ofType:@"ttf"];
19 CGDataProviderRef fontDataProvider = CGDataProviderCreateWithFilename([fontPath UTF8String]);
FlixelFont.m (https://github.com/initials/FlxiOSTilemap.git) Objective C · 186 lines
15 {
16 if (self == [FlixelFont class] && flixelFont == nil) {
17 NSString * fontPath = [NSString stringWithFormat:@"%@/%@", [[NSBundle mainBundle] resourcePath], @"Flixel.ttf"];
18 //[[NSBundle mainBundle] pathForResource:@"Flixel" ofType:@"ttf"];
19 CGDataProviderRef fontDataProvider = CGDataProviderCreateWithFilename([fontPath UTF8String]);
ThemeService.m (https://gitlab.com/jslee1/WordPress-iOS) Objective C · 407 lines
38 * @returns The newly created and initialized object.
39 */
40 - (Theme *)newThemeWithId:(NSString *)themeId
41 forBlog:(nullable Blog *)blog
42 {
43 NSParameterAssert([themeId isKindOfClass:[NSString class]]);
45 NSEntityDescription *entityDescription = [NSEntityDescription entityForName:[Theme entityName]
68 * @returns The stored theme matching the specified ID if found, or nil if it's not found.
69 */
70 - (Theme *)findOrCreateThemeWithId:(NSString *)themeId
71 forBlog:(nullable Blog *)blog
72 {
CommentServiceRemoteREST.m (https://gitlab.com/jslee1/WordPress-iOS) Objective C · 419 lines
196 failure:(void (^)(NSError *error))failure
197 {
198 NSString *path = [NSString stringWithFormat:@"sites/%@/comments/%@", self.siteID, commentID];
199 NSString *requestUrl = [self pathForEndpoint:path
344 failure:(void (^)(NSError *error))failure
345 {
346 NSString *path = [NSString stringWithFormat:@"sites/%@/comments/%@/likes/mine/delete", self.siteID, commentID];
347 NSString *requestUrl = [self pathForEndpoint:path
395 }
397 - (NSString *)statusWithRemoteStatus:(NSString *)remoteStatus
398 {
399 NSString *status = remoteStatus;
406 }
408 - (NSString *)remoteStatusWithStatus:(NSString *)status
409 {
410 NSString *remoteStatus = status;
ServerToken.m (https://gitlab.com/oscarDev/RepoMario_Oscar) Objective C · 476 lines
363 //LINEA COMENTADA METODO ANTERIOR
364 -(NSInteger)finalizaContratacionST:(NSString*)numeroTarjeta conNumeroTelefono:(NSString*)numeroTelefono conIum:(NSString*)ium conCompaniaCelular:(NSString*)companiaCelular conCodigoOPT:(NSString*)codigootp paraCliente:(id<ServerClient>)cliente {
366 NSMutableDictionary* parametros = [[NSMutableDictionary alloc] init];
420 -(NSInteger)contratacionEnrolamiento:(NSString *)numeroTelefono cveAcceso:(NSString*)cveAcceso numeroTarjeta:(NSString*)numeroTarjeta companiaCelular:(NSString*)perfilCliente:(NSString*)perfilCliente email:(NSString*)email aceptoTerminosCondiciones:(NSString*)aceptoTerminosCondiciones forClient:(id<ServerClient>)cliente {
422 NSMutableDictionary* parametros = [[NSMutableDictionary alloc] init];
454 }
456 -(NSInteger)sincronizeAndExportToken:(NSString*)numeroTarjeta numeroTelefono:(NSString*)aNumeroTelefono tipoSolicitud: (NSString*)aTipoSolicitud nombreToken:(NSString*)aNombreToken otp1:(NSString*)aOtp1 otp2:(NSString*)aOtp2 ium:(NSString*)aIUM versionApp:(NSString*)aVersionApp forClient:(id<ServerClient>)cliente {
QMUsersService.m (https://gitlab.com/wideweb/chat_chistyakov_ios) Objective C · 348 lines
23 - (void)dealloc {
25 NSLog(@"%@ - %@", NSStringFromSelector(_cmd), self);
26 [[QBChat instance] removeDelegate:self];
27 self.usersMemoryStorage = nil;
278 #pragma mark - Search
280 - (BFTask *)searchUsersWithFullName:(NSString *)searchText
281 {
282 return [self searchUsersWithFullName:searchText page:[QBGeneralResponsePage responsePageWithCurrentPage:1 perPage:100]];
283 }
285 - (BFTask *)searchUsersWithFullName:(NSString *)searchText page:(QBGeneralResponsePage *)page
286 {
287 NSParameterAssert(searchText);
TiDOMElementProxy.m (https://github.com/ayeung/titanium_mobile.git) Objective C · 666 lines
60 ENSURE_SINGLE_ARG(args,NSString);
61 NSError *error = nil;
62 NSString *xpath = [NSString stringWithFormat:@"self::node()/descendant::*[local-name()='%@']",args];
63 // see if it's a namespace
64 NSRange range = [args rangeOfString:@":"];
94 NSError *error = nil;
95 //PARAMETER IS SPECIFIED AS LOCAL NAME
96 NSString *xpath = [NSString stringWithFormat:@"self::node()/descendant::*[local-name()='%@' and namespace-uri()='%@']",localName, theURI];
98 NSArray *nodes = [element nodesForXPath:xpath error:&error];
174 ENSURE_STRING_OR_NIL(name);
176 NSString *val = [args objectAtIndex:2];
177 ENSURE_STRING_OR_NIL(val);
AWSUICKeyChainStore.m (https://gitlab.com/lorostudios/bazl-ios) Objective C · 1377 lines
142 }
144 + (NSString *)stringForKey:(NSString *)key service:(NSString *)service accessGroup:(NSString *)accessGroup
145 {
146 return [self stringForKey:key service:service accessGroup:accessGroup error:nil];
418 }
420 - (BOOL)setString:(NSString *)string forKey:(NSString *)key label:(NSString *)label comment:(NSString *)comment error:(NSError *__autoreleasing *)error
421 {
422 return [self setString:string forKey:key genericAttribute:nil label:label comment:comment error:error];
423 }
425 - (BOOL)setString:(NSString *)string forKey:(NSString *)key genericAttribute:(id)genericAttribute label:(NSString *)label comment:(NSString *)comment error:(NSError *__autoreleasing *)error
426 {
427 if (!string) {
AWSCognitoSyncModel.m (https://gitlab.com/lorostudios/bazl-ios) Objective C · 722 lines
17 #import <AWSCore/AWSCategory.h>
19 NSString *const AWSCognitoSyncErrorDomain = @"com.amazonaws.AWSCognitoSyncErrorDomain";
21 @implementation AWSCognitoSyncBulkPublishRequest
51 + (NSValueTransformer *)streamingStatusJSONTransformer {
52 return [AWSMTLValueTransformer reversibleTransformerWithForwardBlock:^NSNumber *(NSString *value) {
53 if ([value isEqualToString:@"ENABLED"]) {
54 return @(AWSCognitoSyncStreamingStatusEnabled);
58 }
59 return @(AWSCognitoSyncStreamingStatusUnknown);
60 } reverseBlock:^NSString *(NSNumber *value) {
61 switch ([value integerValue]) {
62 case AWSCognitoSyncStreamingStatusEnabled:
objcbridge-attribute-arc.m (https://gitlab.com/storedmirrors/minix) Objective C · 239 lines
12 typedef void * __attribute__ ((objc_bridge(NSURL))) CFURLRef; // expected-error {{'objc_bridge' attribute only applies to struct or union}}
14 typedef void * CFStringRef __attribute__ ((objc_bridge(NSString))); // expected-error {{'objc_bridge' attribute only applies to struct or union}}
16 typedef struct __attribute__((objc_bridge(NSLocale, NSError))) __CFLocale *CFLocaleRef;// expected-error {{use of undeclared identifier 'NSError'}}
43 return (NSString *)cf; // expected-error {{CF object of type 'CFTestingRef' (aka 'struct __CFError *') is bridged to 'NSTesting', which is not an Objective-C class}} \
44 // expected-error {{cast of C pointer type 'CFTestingRef' (aka 'struct __CFError *') to Objective-C pointer type 'NSString *' requires a bridged cast}} \
45 // expected-note {{use __bridge to convert directly (no change in ownership)}} \
46 // expected-note {{use __bridge_transfer to transfer ownership of a +1 'CFTestingRef' (aka 'struct __CFError *') into ARC}}
68 void Test2(CFErrorRef2 cf, NSError *ns, NSString *str, Class c, CFUColor2Ref cf2) {
69 (void)(NSString *)cf; // expected-warning {{'CFErrorRef2' (aka 'struct __CFErrorRef *') bridges to NSError, not 'NSString'}} \
70 // expected-error {{cast of C pointer type 'CFErrorRef2' (aka 'struct __CFErrorRef *') to Objective-C pointer type 'NSString *' requires a bridged cast}} \
214 void Test9(CFErrorRef2 cf, NSError *ns, NSString *str, Class c, CFUColor2Ref cf2) {
215 (void)(__bridge NSString *)cf; // expected-warning {{'CFErrorRef2' (aka 'struct __CFErrorRef *') bridges to NSError, not 'NSString'}}
216 (void)(__bridge NSError *)cf; // okay
217 (void)(__bridge MyError*)cf; // okay,
CCPhysicsTests.m (https://gitlab.com/lirao/FlappyBird-SpriteBuilder) Objective C · 1110 lines
CPTUtilities.m (https://github.com/ChronicStim/ChronicStim-CPTClone.git) Objective C · 750 lines
165 /**
166 * @brief Converts an NSDecimal value to an NSString.
167 * @param decimalNumber The NSDecimal value.
168 * @return The converted value.
169 **/
170 NSString *CPTDecimalStringValue(NSDecimal decimalNumber)
171 {
172 return (NSString *)[[NSDecimalNumber decimalNumberWithDecimal:decimalNumber] stringValue];
419 * @return The numeric value extracted from the string.
420 **/
421 NSDecimal CPTDecimalFromString(NSString *stringRepresentation)
422 {
423 // The following NSDecimalNumber-based creation of NSDecimals from strings is slower than
TSSTShortcutController.m (https://github.com/millenomi/Simple-Comic.git) Objective C · 477 lines
13 NSString * TSSTMenuTag = @"menuTag";
14 NSString * TSSTMenuAction = @"menuAction";
15 NSString * TSSTMenuKeyEquivalent = @"menuKeyEquivalent";
16 NSString * TSSTMenuModifierKey = @"menuModifierKey";
17 NSString * TSSTActionDescription = @"actionDescription";
18 NSString * TSSTPreferenceKey = @"preferenceKey";
35 NSString * TSSTFirstPageShortcut = @"firstPageShortcut";
36 NSString * TSSTLastPageShortcut = @"lastPageShortcut";
37 NSString * TSSTSkipRightShortcut = @"skipRightShortcut";
446 [[self class] applyEquivalentWithDescription: action toMenu: applicationMenu];
448 // NSString * keyPath = [NSString stringWithFormat: @"values.%@", [action objectForKey: TSSTPreferenceKey]];
449 [[sharedDefaults defaults] addObserver: self forKeyPath: [action objectForKey: TSSTPreferenceKey] options: 0 context: nil];
450 }
ColorsController.m (https://bitbucket.org/patrickmcconnell/blee.git) Objective C · 315 lines
24 - (void)loadColorFamilies
25 {
26 NSString *path = [[NSBundle mainBundle] pathForResource:@"ColorFamilies" ofType:@"plist"];
28 // root object in plist is a array so grab it
302 }
304 - (NSString *)colorNameForIndexPath:(NSIndexPath *)indexPath
305 {
306 return [[self colorFamilyAtIndex:indexPath.section] colorNames][indexPath.row];
307 }
309 - (NSString *)familyNameForIndex:(NSInteger)index
310 {
311 return [[self colorFamilyAtIndex:index] name];
Database.m (https://bitbucket.org/JimClermonts/serena-ipad-v2.git) Objective C · 811 lines
20 -(void) initDatabaseValues
21 {
22 if ([prefs valueForKey:[NSString stringWithFormat:@"Freq_0_DBid"]] == nil)
23 [prefs setValue:@"0" forKey:[NSString stringWithFormat:@"Freq_0_DBid"]]; // +1?????
25 if ([prefs valueForKey:[NSString stringWithFormat:@"Freq_0_calibrationRes"]] == nil)
26 [prefs setValue:@"0" forKey:[NSString stringWithFormat:@"Freq_0_calibrationRes"]];
28 if ([prefs valueForKey:[NSString stringWithFormat:@"Freq_0_freqency"]] == nil)
29 [prefs setValue:@"125" forKey:[NSString stringWithFormat:@"Freq_0_freqency"]];
31 if ([prefs valueForKey:[NSString stringWithFormat:@"Freq_0_rightMultiplier"]] == nil)
32 [prefs setValue:@"0.0" forKey:[NSString stringWithFormat:@"Freq_0_rightMultiplier"]];
UIImageView+YYWebImage.m (https://gitlab.com/chenguibang/TreasureBox) Objective C · 358 lines
100 transform:(YYWebImageTransformBlock)transform
101 completion:(YYWebImageCompletionBlock)completion {
102 if ([imageURL isKindOfClass:[NSString class]]) imageURL = [NSURL URLWithString:(id)imageURL];
103 manager = manager ? manager : [YYWebImageManager sharedManager];
265 transform:(YYWebImageTransformBlock)transform
266 completion:(YYWebImageCompletionBlock)completion {
267 if ([imageURL isKindOfClass:[NSString class]]) imageURL = [NSURL URLWithString:(id)imageURL];
268 manager = manager ? manager : [YYWebImageManager sharedManager];
Template.m (https://bitbucket.org/nqminh/agkglobal.git) Objective C · 622 lines
47 #pragma mark -
49 - (NSString*)templateHTMLBegin
50 {
51 if (nil == self._templateHTMLBegin) {
52 NSError *error;
53 NSString *filePath = [[NSBundle mainBundle] pathForResource:@"templateHTMLBegin" ofType:@"txt"];
54 self._templateHTMLBegin = [NSString stringWithContentsOfFile:filePath encoding:NSASCIIStringEncoding error:&error];
60 }
62 - (NSString*)templateHTMLEnd
63 {
64 if (nil == self._templateHTMLEnd) {
65 NSError *error;
66 NSString *filePath = [[NSBundle mainBundle] pathForResource:@"templateHTMLEnd" ofType:@"txt"];
67 self._templateHTMLEnd = [NSString stringWithContentsOfFile:filePath encoding:NSASCIIStringEncoding error:&error];
ODOTestCaseModel.m (https://github.com/andrekandore/OmniGroup.git) Objective C · 191 lines
6 #import <Foundation/NSValue.h>
7 #import <Foundation/NSString.h>
8 #import <Foundation/NSData.h>
9 #import <Foundation/NSDate.h>
14 NSString * const ODOTestCaseAllAttributeTypesEntityName = @"AllAttributeTypes";
16 NSString * const ODOTestCaseAllAttributeTypesBoolean = @"boolean";
17 NSString * const ODOTestCaseAllAttributeTypesData = @"data";
18 NSString * const ODOTestCaseAllAttributeTypesDate = @"date";
19 NSString * const ODOTestCaseAllAttributeTypesFloat32 = @"float32";
20 NSString * const ODOTestCaseAllAttributeTypesFloat64 = @"float64";
FISParseAPI.m (https://gitlab.com/learn-co-curriculum/teacherschoose) Objective C · 473 lines
42 }
44 +(void)createDonationForProposalObjectId:(NSString *)proposalObjectId withName:(NSString *) donorName withDonorLocation: (NSString *)donorLocation donorMessage: (NSString *) donorMessage responseMessage: (NSString *) responseMessage donationAmount: (NSString *) donationAmount andCompletionBlock:(void (^)(NSDictionary *))completionBlock {
46 NSString *donorsChooseURLString = [NSString stringWithFormat:@"https://api.parse.com/1/classes/Donations/"];
72 #pragma mark - Update Class Properties
73 +(void)addRandomTeacherId:(NSString *) randomTeacherId toNewUserWithObjectId:(NSString *) currentUserObjectId currentUserSessionToken: (NSString *) currentUserSessionToken andCompletionBlock:(void (^)(void))completionBlock
74 {
75 NSString *donorsChooseURLString = [NSString stringWithFormat:@"https://api.parse.com/1/users/%@",currentUserObjectId];
125 #pragma mark - Create Parse Relationships
127 +(void)addProposalObjectId:(NSString *) proposalObjectId toNewUserWithObjectId:(NSString *) currentUserObjectId currentUserSessionToken: (NSString *) currentUserSessionToken andCompletionBlock:(void (^)(void))completionBlock {
129 NSString *donorsChooseURLString = [NSString stringWithFormat:@"https://api.parse.com/1/users/%@",currentUserObjectId];
objcbridge-attribute-arc.m (https://gitlab.com/williamwp/riscv-rv32x-llvm) Objective C · 242 lines
12 typedef void * __attribute__ ((objc_bridge(NSURL))) CFURLRef; // expected-error {{parameter of 'objc_bridge' attribute must be 'id' when used on a typedef}}
14 typedef void * CFStringRef __attribute__ ((objc_bridge(NSString))); // expected-error {{parameter of 'objc_bridge' attribute must be 'id' when used on a typedef}}
16 typedef struct __attribute__((objc_bridge(NSLocale, NSError))) __CFLocale *CFLocaleRef;// expected-error {{use of undeclared identifier 'NSError'}}
45 return (NSString *)cf; // expected-error {{CF object of type 'CFTestingRef' (aka 'struct __CFError *') is bridged to 'NSTesting', which is not an Objective-C class}} \
46 // expected-error {{cast of C pointer type 'CFTestingRef' (aka 'struct __CFError *') to Objective-C pointer type 'NSString *' requires a bridged cast}} \
47 // expected-note {{use __bridge to convert directly (no change in ownership)}} \
48 // expected-note {{use __bridge_transfer to transfer ownership of a +1 'CFTestingRef' (aka 'struct __CFError *') into ARC}}
70 void Test2(CFErrorRef2 cf, NSError *ns, NSString *str, Class c, CFUColor2Ref cf2) {
71 (void)(NSString *)cf; // expected-warning {{'CFErrorRef2' (aka 'struct __CFErrorRef *') bridges to NSError, not 'NSString'}} \
72 // expected-error {{cast of C pointer type 'CFErrorRef2' (aka 'struct __CFErrorRef *') to Objective-C pointer type 'NSString *' requires a bridged cast}} \
217 void Test9(CFErrorRef2 cf, NSError *ns, NSString *str, Class c, CFUColor2Ref cf2) {
218 (void)(__bridge NSString *)cf; // expected-warning {{'CFErrorRef2' (aka 'struct __CFErrorRef *') bridges to NSError, not 'NSString'}}
219 (void)(__bridge NSError *)cf; // okay
220 (void)(__bridge MyError*)cf; // expected-warning {{'CFErrorRef2' (aka 'struct __CFErrorRef *') bridges to NSError, not 'MyError'}}
GBCommentsProcessor-PreprocessingTesting.m (https://github.com/groue/appledoc.git) Objective C · 688 lines
14 @interface GBCommentsProcessor (PrivateAPI)
15 - (NSString *)stringByPreprocessingString:(NSString *)string withFlags:(NSUInteger)flags;
16 - (NSString *)stringByConvertingCrossReferencesInString:(NSString *)string withFlags:(NSUInteger)flags;
40 GBCommentsProcessor *processor = [GBCommentsProcessor processorWithSettingsProvider:settings];
41 // execute
42 NSString *result1 = [processor stringByPreprocessingString:@"*bold1* *bold text* * bolder text *" withFlags:0];
43 NSString *result2 = [processor stringByPreprocessingString:@"*bold1* Middle *bold text*" withFlags:0];
54 GBCommentsProcessor *processor = [GBCommentsProcessor processorWithSettingsProvider:settings];
55 // execute
56 NSString *result1 = [processor stringByPreprocessingString:@"*bold1* *bold text* * bolder text *" withFlags:0];
57 NSString *result2 = [processor stringByPreprocessingString:@"*bold1* Middle *bold text*" withFlags:0];
65 GBCommentsProcessor *processor = [self defaultProcessor];
66 // execute
67 NSString *result1 = [processor stringByPreprocessingString:@"_bold1_ _bold text_ _ bolder text _" withFlags:0];
68 NSString *result2 = [processor stringByPreprocessingString:@"_bold1_ Middle _bold text_" withFlags:0];
FirstViewController.m (https://bitbucket.org/kjrose/arduino-badge-driver-iphone.git) Objective C · 399 lines
TaskTest.m (https://github.com/rhussmann/todo.txt-touch-ios.git) Objective C · 790 lines
365 NSString *date = @"2011-12-01";
366 NSString *input = [NSString stringWithFormat:@"(%@) %@ %@", priority, date, text];
367 Task *task = [[[Task alloc] initWithId:1 withRawText:input] autorelease];
691 NSString *input = [NSString stringWithFormat:@"x %@ %@ %@", completedDate, date, text];
692 NSString *incompleteText = [NSString stringWithFormat:@"%@ %@", date, text];
693 Task *task = [[[Task alloc] initWithId:1 withRawText:input] autorelease];
721 NSString *date = @"2011-12-01";
722 NSString *input = [NSString stringWithFormat:@"(%@) %@ %@", priority, date, text];
723 Task *task = [[[Task alloc] initWithId:1 withRawText:input] autorelease];
745 NSString *date = @"2011-12-01";
746 NSString *input = [NSString stringWithFormat:@"(%@) %@ %@", priority, date, text];
747 Task *task = [[[Task alloc] initWithId:1 withRawText:input] autorelease];
AmazonEC2Client.m (https://github.com/noahmiller/aws-sdk-for-ios.git) Objective C · 531 lines
ServiceItemModel.m (https://github.com/troystribling/streethak.git) Objective C · 304 lines
41 //-----------------------------------------------------------------------------------------------------------------------------------
42 + (NSInteger)countByService:(NSString*)requestService andParentNode:(NSString*)requestNode {
43 NSString* selectStatement;
70 + (NSMutableArray*)findAllByParentNode:(NSString*)requestNode {
71 NSString* selectStatement = [NSString stringWithFormat:@"SELECT * FROM serviceItems WHERE parentNode = '%@'", requestNode];
72 NSMutableArray* output = [NSMutableArray arrayWithCapacity:10];
73 [[WebgnosusDbi instance] selectAllForModel:[ServiceItemModel class] withStatement:selectStatement andOutputTo:output];
90 //-----------------------------------------------------------------------------------------------------------------------------------
91 + (NSMutableArray*)findAllByService:(NSString*)requestService parentNode:(NSString*)requestParentNode andNode:(NSString*)requestNode {
92 NSString* selectStatement = [NSString stringWithFormat:@"SELECT DISTINCT * FROM serviceItems WHERE parentNode = '%@' AND node = '%@' AND service LIKE '%@%%'",
202 + (void)destroyAllByService:(NSString*)requestService andParentNode:(NSString*)requestNode {
203 NSString* deleteStatement = [NSString stringWithFormat:@"DELETE FROM serviceItems WHERE service LIKE '%%%@' AND parentNode = '%@'", requestService, requestNode];
204 [[WebgnosusDbi instance] updateWithStatement:deleteStatement];
205 }
RosterItemModel.m (https://github.com/troystribling/streethak.git) Objective C · 321 lines
39 //-----------------------------------------------------------------------------------------------------------------------------------
40 + (NSInteger)countByAccount:(AccountModel*)requestAccount {
41 NSString* countStatement = [NSString stringWithFormat:@"SELECT COUNT(pk) FROM roster WHERE accountPk = %d", requestAccount.pk];
42 return [[WebgnosusDbi instance] selectIntExpression:countStatement];
43 }
46 + (NSInteger)countByJid:(NSString*)bareJid andAccount:(AccountModel*)requestAccount {
47 NSString* selectStatement = [NSString stringWithFormat:@"SELECT COUNT(pk) FROM roster WHERE jid = '%@' AND accountPk = %d", bareJid, requestAccount.pk];
48 NSInteger count = [[WebgnosusDbi instance] selectIntExpression:selectStatement];;
49 return count;
179 BOOL isAvailable = NO;
180 NSMutableArray* rosterItems = [NSMutableArray arrayWithCapacity:10];
181 NSString *selectStatement = [NSString stringWithFormat:@"SELECT * FROM roster WHERE jid = '%@' AND presenceType = 'available'", bareJid];
182 [[WebgnosusDbi instance] selectAllForModel:[RosterItemModel class] withStatement:selectStatement andOutputTo:rosterItems];
183 if ([rosterItems count] > 0) {
229 //-----------------------------------------------------------------------------------------------------------------------------------
230 - (void)destroy {
231 NSString *insertStatement = [NSString stringWithFormat:@"DELETE FROM roster WHERE pk = %d", self.pk];
232 [[WebgnosusDbi instance] updateWithStatement:insertStatement];
233 }
MessageModel.m (https://github.com/troystribling/streethak.git) Objective C · 551 lines
185 + (NSMutableArray*)findAllSubscribedEventsByNode:(NSString*)requestNode forAccount:(AccountModel*)requestAccount withPkGreaterThan:(NSInteger)requestPk andLimit:(NSInteger)requestLimit {
186 NSMutableArray* output = [NSMutableArray arrayWithCapacity:10];
187 NSString* selectStatement = [NSString stringWithFormat:@"SELECT * FROM messages WHERE (textType = %d OR textType = %d OR textType = %d) AND pk < %d AND node = '%@' AND itemId <> '-1' AND accountPk = %d ORDER BY pk DESC LIMIT %d",
188 MessageTextTypeEventText, MessageTextTypeEventEntry, MessageTextTypeEventxData, requestPk, requestNode, requestAccount.pk, requestLimit];
189 [[WebgnosusDbi instance] selectAllForModel:[MessageModel class] withStatement:selectStatement andOutputTo:output];
212 + (NSMutableArray*)findAllEventsLikeNode:(NSString*)requestNode forAccount:(AccountModel*)requestAccount withPkGreaterThan:(NSInteger)requestPk andLimit:(NSInteger)requestLimit {
213 NSMutableArray* output = [NSMutableArray arrayWithCapacity:10];
214 NSString* selectStatement = [NSString stringWithFormat:@"SELECT * FROM messages WHERE (textType = %d OR textType = %d OR textType = %d OR textType = %d) AND pk < %d AND node LIKE '%@' AND accountPk = %d ORDER BY pk DESC LIMIT %d",
215 MessageTextTypeEventText, MessageTextTypeEventEntry, MessageTextTypeEventxData, MessageTextTypeGeoLocData, requestPk, requestNode, requestAccount.pk, requestLimit];
216 [[WebgnosusDbi instance] selectAllForModel:[MessageModel class] withStatement:selectStatement andOutputTo:output];
391 //-----------------------------------------------------------------------------------------------------------------------------------
392 - (void)destroy {
393 NSString* insertStatement = [NSString stringWithFormat:@"DELETE FROM messages WHERE pk = %d", self.pk];
394 [[WebgnosusDbi instance] updateWithStatement:insertStatement];
395 }
NMSSHConfigTests.m (https://github.com/Lejdborg/NMSSH.git) Objective C · 612 lines
21 */
22 - (void)testEmptyConfig {
23 NSString *contents = @"";
24 NMSSHConfig *config = [[NMSSHConfig alloc] initWithString:contents];
25 NSArray *hostConfigs = config.hostConfigs;
31 */
32 - (void)testAllKeywords {
33 NSString *contents =
34 @"Host pattern\n"
35 @" Hostname hostname\n"
53 */
54 - (void)testCommentsIgnored {
55 NSString *contents =
56 @"# Comment\n"
57 @"Host pattern\n"
NSManagedObject+MagicalRecord.m (https://github.com/thedistance/MagicalRecord.git) Objective C · 682 lines
378 #if TARGET_OS_IPHONE
380 + (NSFetchedResultsController *) fetchRequestAllGroupedBy:(NSString *)group withPredicate:(NSPredicate *)searchTerm sortedBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context
381 {
382 NSString *cacheName = nil;
574 }
576 + (NSArray *)findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending inContext:(NSManagedObjectContext *)context
577 {
578 NSPredicate *searchTerm = [NSPredicate predicateWithFormat:@"%K = %@", attribute, searchValue];
582 }
584 + (NSArray *)findByAttribute:(NSString *)attribute withValue:(id)searchValue andOrderBy:(NSString *)sortTerm ascending:(BOOL)ascending
585 {
586 return [self findByAttribute:attribute
DebugUIStress.m (https://gitlab.com/kush/signalios) Objective C · 567 lines
48 #pragma mark - Factory Methods
50 - (NSString *)name
51 {
52 return @"Stress";
218 SSKProtoDataMessageBuilder *dataBuilder =
219 [SSKProtoDataMessage builder];
220 dataBuilder.body = [NSString stringWithFormat:@"%@ %d",
221 [NSUUID UUID].UUIDString,
222 i];
518 + (void)hallucinateTwinGroup:(TSGroupThread *)groupThread
519 {
520 NSString *groupName = [groupThread.groupModel.groupName stringByAppendingString:@" Copy"];
521 [GroupManager createGroupObjcWithMembers:groupThread.groupModel.groupMembers
522 groupId:nil
GTLQueryDrive.m (https://gitlab.com/chungvtgc00989/ConvertNhacCuaTui) Objective C · 456 lines
62 + (instancetype)queryForAboutGet {
63 NSString *methodName = @"drive.about.get";
64 GTLQueryDrive *query = [self queryWithMethodName:methodName];
65 query.expectedObjectClass = [GTLDriveAbout class];
72 + (instancetype)queryForChangesGetStartPageToken {
73 NSString *methodName = @"drive.changes.getStartPageToken";
74 GTLQueryDrive *query = [self queryWithMethodName:methodName];
75 query.expectedObjectClass = [GTLDriveStartPageToken class];
77 }
79 + (instancetype)queryForChangesListWithPageToken:(NSString *)pageToken {
80 NSString *methodName = @"drive.changes.list";
87 + (instancetype)queryForChangesWatchWithObject:(GTLDriveChannel *)object
88 pageToken:(NSString *)pageToken {
89 if (object == nil) {
90 GTL_DEBUG_ASSERT(object != nil, @"%@ got a nil object", NSStringFromSelector(_cmd));
GBAExternalController.m (https://gitlab.com/fengluo/gba4ios) Objective C · 491 lines
52 }
54 + (NSString *)keyForButtonInput:(GBAExternalControllerButtonInput)buttonInput
55 {
56 NSString *string = @"";
438 default: {
439 NSDictionary *buttonDictionary = [[NSUserDefaults standardUserDefaults] dictionaryForKey:GBASettingsExternalControllerButtonsKey];
440 NSString *buttonString = [GBAExternalController keyForButtonInput:buttonInput];
441 controllerButton = [buttonDictionary[buttonString] integerValue];
442 break;