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
// | |
// UIColor-HSVAdditions.h | |
// | |
// Created by Matt Reagan (bravobug.com) on 12/31/09. | |
// | |
// | |
// Copyright 2010 Fabián Cañas. All rights reserved. | |
// | |
// Redistribution and use in source and binary forms, with or without |
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
#import <Foundation/Foundation.h> | |
#import <objc/runtime.h> | |
@interface MyDecimalNumber : NSDecimalNumber | |
@end | |
@implementation MyDecimalNumber | |
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
// | |
// main.m | |
// fastenumvsblockenum | |
#import <Foundation/Foundation.h> | |
@implementation NSMutableArray (RandomUtils) | |
-(void)shuffle |
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
a answer to http://stackoverflow.com/questions/19087078/i-want-correct-format-of-this-code | |
First you should not use view's tag like that. Instead check the identity against a member/property. | |
Second I called your count variable idx — as it is a index variable. | |
As a pre-condition I check, if both arrays have the same size. Of course it would be much nicer to keep the information together: one NSDictionary per photo and caption. even better: a PhotoAlbumItem that stores both as properties. |
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
#import <Foundation/Foundation.h> | |
NSUInteger euclid(NSUInteger a, NSUInteger b) | |
{ | |
while (b > 0) { | |
if (a > b) { | |
a = a - b; | |
} else { | |
b = b - a; |
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
#import <Foundation/Foundation.h> | |
int main(int argc, const char * argv[]) | |
{ | |
@autoreleasepool { | |
NSString *jsonString = @"{\"corpUserWs\":{\"loginMsg\":\"User is locked out. Please request for your account to be unlocked.\",\"requestStatus\":0,\"sessionId\":\"16gxtse746yqj\"}}"; | |
NSString *jsonString2 = @"[{\"corpUserWs\":{\"loginMsg\":\"User is locked out. Please request for your account to be unlocked.\",\"requestStatus\":0,\"sessionId\":\"16gxtse746yqj\"}}]"; |
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
NSMutableArray *array = [@[@1,@2,@3,@4,@5, @6, @7, @8,@9, @10] mutableCopy]; | |
for (int i =0 ; i< [array count]; ++i) { | |
if ([array[i] integerValue]> 3 && [array[i] integerValue]< 8) { | |
[array removeObjectAtIndex:i]; | |
} | |
} | |
// we want to get an array containg [@1, @2, @3, @8, @9, @10] | |
// but we get [@1, @2, @3, @5, @7, @8, @9, @10] |
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
#import <Foundation/Foundation.h> | |
@interface Item : NSObject | |
@property NSInteger itemID; | |
@property NSInteger typeID; | |
@property(copy) NSString *itemDescription; | |
@end | |
@implementation Item |
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
#import <Foundation/Foundation.h> | |
@interface Birthday : NSObject | |
@property (nonatomic, strong) NSDate *birthday; | |
@property (nonatomic, copy) NSString *name; | |
-(id)initWithName:(NSString *) name birthdayDate:(NSDate *) date; | |
@end |
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
#import <Foundation/Foundation.h> | |
@interface MyClass : NSObject | |
- (NSString *)actualPhotoPath:(NSDictionary *)input; | |
@end | |
@implementation MyClass |
OlderNewer