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> | |
@implementation NSArray (BlocksTest) | |
- (void) do:(void (^)(id))aBlock; | |
{ | |
[self enumerateObjectsUsingBlock:^(id obj, NSUInteger idx, BOOL *stop) | |
{ | |
aBlock(obj); | |
}]; |
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
@interface Class0 @end | |
@interface Class1 @end | |
@interface Class2 {} | |
+ (id)test:(Class0 *)class; | |
- (id)test:(Class0 *)class; | |
@end | |
@interface Class3 {} | |
+ (id)test:(Class1 *)class; |
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 "PSYSmallTalkBlocks.h" | |
int main (int argc, const char * argv[]) | |
{ | |
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init]; | |
int value = 0; | |
[PSYNumObj(value == 10) ifTrue:PSYIdVoidBlk({ |
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
/* | |
Copyright (c) 2009 Remy Demarest | |
Permission is hereby granted, free of charge, to any person | |
obtaining a copy of this software and associated documentation | |
files (the "Software"), to deal in the Software without | |
restriction, including without limitation the rights to use, | |
copy, modify, merge, publish, distribute, sublicense, and/or sell | |
copies of the Software, and to permit persons to whom the | |
Software is furnished to do so, subject to the following |
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
/* | |
Copyright (c) 2008, Remy Demarest | |
All rights reserved. | |
Redistribution and use in source and binary forms, with or without | |
modification, are permitted provided that the following conditions are met: | |
* Redistributions of source code must retain the above copyright | |
notice, this list of conditions and the following disclaimer. | |
* Redistributions in binary form must reproduce the above copyright | |
notice, this list of conditions and the following disclaimer in the |
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
NSPoint PSYPointInBezierPath(NSPoint *points, NSInteger pointCount, CGFloat t, | |
NSPoint *getPoints, NSInteger getPointCount) | |
{ | |
if(getPointCount > 0 && pointCount == getPointCount) | |
for(int i = 0; i < getPointCount; i++) | |
getPoints[i] = points[i]; | |
if(pointCount <= 1) return *points; | |
NSPoint *newPoints = calloc(pointCount - 1, sizeof(NSPoint)); |
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
/* | |
NSMutableData+PSYDataWriter.h | |
Created by Remy "Psy" Demarest on 22/01/2012. | |
Copyright (c) 2012. Remy "Psy" Demarest | |
Permission is hereby granted, free of charge, to any person obtaining a copy | |
of this software and associated documentation files (the "Software"), to deal | |
in the Software without restriction, including without limitation the rights | |
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell |
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
/* | |
* PSYLayerConstraintLayoutManager.h | |
* LayoutManager | |
* | |
* Created by Remy Demarest on 27/02/2010. | |
* Copyright (c) 2010, Remy Demarest | |
* All rights reserved. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions are met: |
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 <UIKit/UIKit.h> | |
@interface UIControl (PSYBlockTargetAddition) | |
- (id)addTargetForControlEvents:(UIControlEvents)controlEvents usingBlock:(void(^)(id sender, UIEvent *event))block; | |
- (void)removeTarget:(id)target forControlEvents:(UIControlEvents)controlEvents; | |
@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
isClass = [object PSYJK_JSONClass]; | |
if(isClass == PSYJKClassUnknown |
OlderNewer