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
#import <Foundation/Foundation.h> | |
@interface Account : NSObject | |
{ | |
float openingBalance; | |
NSString* name; | |
NSString* note; | |
NSMutableArray* transactions; | |
} |
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
#import <Foundation/Foundation.h> | |
void testForNumber(){ | |
NSLog(@"%s", __func__); | |
NSNumber* number11 = [NSNumber numberWithInt:11]; | |
NSNumber* number22 = [NSNumber numberWithInt:22]; | |
switch([number11 compare:number22]){ | |
case NSOrderedAscending: | |
NSLog(@"NSOrderedAscending"); |
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
#import <Foundation/Foundation.h> | |
class HelloWorld; | |
@interface PLog:NSObject { | |
HelloWorld *ptr; | |
} | |
- (void)sayHello; | |
- (void)sayHi:(HelloWorld *)p; |
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
#import <Foundation/Foundation.h> | |
int main() { | |
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; | |
NSDictionary* dictionary = [NSMutableDictionary dictionary]; | |
NSLog(@"%@", dictionary); | |
[dictionary setValue:@"value1" forKey:@"key1"]; | |
NSLog(@"%@", dictionary); |
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
#import <Foundation/Foundation.h> | |
@interface Person : NSObject | |
{ | |
NSString *name; | |
NSString *email; | |
int age; | |
} | |
@end |
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
#import <Foundation/Foundation.h> | |
int main(int argc, char** argv) { | |
NSAutoreleasePool* pool = [[NSAutoreleasePool alloc] init]; | |
id path = [NSString stringWithCString:argv[1] | |
encoding:NSASCIIStringEncoding]; | |
id data = [NSData dataWithContentsOfFile:path]; | |
id plist = [NSPropertyListSerialization | |
propertyListFromData:data |
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
#import <Foundation/Foundation.h> | |
#define MAXMEMBER 8 | |
@interface Team : NSObject | |
{ | |
id members[MAXMEMBER]; | |
int count; | |
} | |
- (NSUInteger)countOfFellows; |
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
package{ | |
import flash.display.Sprite; | |
import flash.events.Event; | |
public class Wave1 extends Sprite{ | |
private var ball:Ball; | |
private var angle:Number = 0; | |
private var centerY:Number = 200; | |
private var range:Number = 50; | |
private var xspeed:Number = 1; |
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
// akio0911 | |
glColor4ub(255, 0, 0, 255); | |
glLineWidth(5); | |
CGPoint vertices3[] = { ccp(100,100), ccp(200,100), ccp(200,200), ccp(100,200), ccp(100,100) }; | |
drawPoly( vertices3, 5, NO); |
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 fillTriangles( CGPoint *poli, int points ) | |
{ | |
glVertexPointer(2, GL_FLOAT, 0, poli); | |
glEnableClientState(GL_VERTEX_ARRAY); | |
glDrawArrays(GL_TRIANGLES, 0, points); | |
glDisableClientState(GL_VERTEX_ARRAY); | |
} |