| 1 |
@protocol Printing: someParent |
| 2 |
-(void) print; |
| 3 |
@end |
| 4 |
|
| 5 |
@interface Fraction: NSObject <Printing, NSCopying> { |
| 6 |
int numerator; |
| 7 |
int denominator; |
| 8 |
} |
| 9 |
@end |
| 10 |
|
| 11 |
@"blah\8" @"a\222sd\d" @"\faw\"\? \' \4 n\\" @"\56" |
| 12 |
@"\xSF42" |
| 13 |
|
| 14 |
-(NSDecimalNumber*)addCount:(id)addObject{ |
| 15 |
|
| 16 |
return [count decimalNumberByAdding:addObject.count]; |
| 17 |
|
| 18 |
} |
| 19 |
|
| 20 |
NS_DURING NS_HANDLER NS_ENDHANDLER |
| 21 |
|
| 22 |
@try { |
| 23 |
if (argc > 1) { |
| 24 |
@throw [NSException exceptionWithName:@"Throwing a test exception" reason:@"Testing the @throw directive." userInfo:nil]; |
| 25 |
} |
| 26 |
} |
| 27 |
@catch (id theException) { |
| 28 |
NSLog(@"%@", theException); |
| 29 |
result = 1 ; |
| 30 |
} |
| 31 |
@finally { |
| 32 |
NSLog(@"This always happens."); |
| 33 |
result += 2 ; |
| 34 |
} |
| 35 |
|
| 36 |
@synchronized(lock) { |
| 37 |
NSLog(@"Hello World"); |
| 38 |
} |
| 39 |
|
| 40 |
struct { @defs( NSObject) } |
| 41 |
|
| 42 |
char *enc1 = @encode(int); |
| 43 |
|
| 44 |
IBOutlet|IBAction|BOOL|SEL|id|unichar|IMP|Class |
| 45 |
|
| 46 |
|
| 47 |
@class @protocol |
| 48 |
|
| 49 |
@public |
| 50 |
// instance variables |
| 51 |
@package |
| 52 |
// instance variables |
| 53 |
@protected |
| 54 |
// instance variables |
| 55 |
@private |
| 56 |
// instance variables |
| 57 |
|
| 58 |
YES NO Nil nil |
| 59 |
NSApp() |
| 60 |
NSRectToCGRect (Protocol ProtocolFromString:"NSTableViewDelegate")) |
| 61 |
|
| 62 |
[SPPoint pointFromCGPoint:self.position] |
| 63 |
|
| 64 |
NSRoundDownToMultipleOfPageSize |
| 65 |
|
| 66 |
#import <stdio.h> |
| 67 |
|
| 68 |
int main( int argc, const char *argv[] ) { |
| 69 |
printf( "hello world\n" ); |
| 70 |
return 0; |
| 71 |
} |
| 72 |
|
| 73 |
NSChangeSpelling |
| 74 |
|
| 75 |
@"0 != SUBQUERY(image, $x, 0 != SUBQUERY($x.bookmarkItems, $y, $y.@count == 0).@count).@count" |
| 76 |
|
| 77 |
@selector(lowercaseString) @selector(uppercaseString:) |
| 78 |
|
| 79 |
NSFetchRequest *localRequest = [[NSFetchRequest alloc] init]; |
| 80 |
localRequest.entity = [NSEntityDescription entityForName:@"VNSource" inManagedObjectContext:context]; |
| 81 |
localRequest.sortDescriptors = [NSArray arrayWithObject:[NSSortDescriptor sortDescriptorWithKey:@"resolution" ascending:YES]]; |
| 82 |
NSPredicate *predicate = [NSPredicate predicateWithFormat:@"0 != SUBQUERY(image, $x, 0 != SUBQUERY($x.bookmarkItems, $y, $y.@count == 0).@count).@count"]; |
| 83 |
[NSPredicate predicateWithFormat:] |
| 84 |
NSString *predicateString = [NSString stringWithFormat:@"SELF beginsWith[cd] %@", searchString]; |
| 85 |
NSPredicate *pred = [NSPredicate predicateWithFormat:predicateString]; |
| 86 |
NSArray *filteredKeys = [[myMutableDictionary allKeys] filteredArrayUsingPredicate:pred]; |
| 87 |
|
| 88 |
localRequest.predicate = [NSPredicate predicateWithFormat:@"whichChart = %@" argumentArray: listChartToDownload]; |
| 89 |
localRequest.fetchBatchSize = 100; |
| 90 |
arrayRequest = [context executeFetchRequest:localRequest error:&error1]; |
| 91 |
|
| 92 |
[localRequest release]; |
| 93 |
|
| 94 |
#ifndef Nil |
| 95 |
#define Nil __DARWIN_NULL /* id of Nil class */ |
| 96 |
#endif |
| 97 |
|
| 98 |
@implementation MyObject |
| 99 |
- (unsigned int)areaOfWidth:(unsigned int)width |
| 100 |
height:(unsigned int)height |
| 101 |
{ |
| 102 |
return width*height; |
| 103 |
} |
| 104 |
@end |