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 <UIKit/UIKit.h> | |
| @interface FlowerTableViewController : UITableViewController | |
| { | |
| NSMutableArray *redFlowers; | |
| NSMutableArray *blueFlowers; | |
| } | |
| @property (nonatomic, retain) NSMutableArray *redFlowers; | |
| @property (nonatomic, retain) NSMutableArray *blueFlowers; |
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)appendBytes:(const void *)bytes length:(NSUInteger)length | |
| NSString *myString = @"testing"; | |
| NSUInteger number = 5; | |
| NSMutableData *myData; | |
| [myData appendBytes: &myString length: number]; | |
| NSLog (@"%@", myData); |
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
| NSString *myString = @"Testing"; | |
| NSUInteger number = 7; | |
| NSData *myData = [NSData dataWithBytes: &myString length: number]; | |
| //--------------------- | |
| NSMutableData *myData = [NSMutableData dataWithCapacity: 4]; | |
| NSLog (@"%@", myData); |
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
| // + (NSNumber *)numberWithUnsignedInt:(unsigned int)value | |
| NSNumber *number = [NSNumber numberWithUnsignedInt: 4]; | |
| NSLog (@"%@", number); | |
| //--------------------- | |
| NSNumber *number = [NSNumber numberWithUnsignedLong: 43452]; |
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
| NSNumber *number = [NSNumber numberWithBool: FALSE]; | |
| NSLog (@"%@", number); | |
| //--------------------- | |
| NSNumber *number = [NSNumber numberWithChar: 'd']; | |
| NSLog (@"%@", number); | |
| //--------------------- | |
| NSNumber *num = [NSNumber numberWithFloat: 2.3]; |
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
| // + (id)URLWithString:(NSString *)URLString | |
| NSURL *myURL = [NSURL URLWithString: @"www.google.com"]; | |
| NSLog (@"%@", myURL); | |
| //--------------------- | |
| // - (id)initWithString:(NSString *)URLString | |
| NSURL *myURL = [[NSURL alloc] initWithString: @"www.google.com"]; |
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
| NSIndexPath *myIndex = [NSIndexPath indexPathWithIndex: 4]; | |
| NSLog (@"%@", myIndex); | |
| // --------------------- | |
| NSIndexPath *myIndex = [[NSIndexPath alloc] initWithIndex: 3]; | |
| NSLog (@"%@", myIndex); |
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
| -(IBAction) firstButton: (id) sender | |
| { | |
| //+ (UIFont *)fontWithName:(NSString *)fontName size: (CGFloat) fontSize | |
| UIFont *test = [UIFont fontWithName: @"Courier" size: 12]; | |
| [firstLabel setFont: test]; | |
| } | |
| -(IBAction) firstButton: (id) sender | |
| { | |
| //- (UIFont *)fontWithSize:(CGFloat)fontSize |
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
| NSArray *numbers = [[NSArray alloc] initWithObjects: @"One", @"Two", @"Three", nil]; | |
| NSEnumerator *test = [numbers objectEnumerator]; | |
| NSLog (@"%@", test); | |
| NSArray *allObjects = [test allObjects]; | |
| NSLog (@"%@", allObjects); | |
| NSArray *anArray = [[NSArray alloc] initWithObjects: @"One", @"Two", @"Three", nil]; | |
| NSEnumerator *enumerator = [anArray objectEnumerator]; |
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
| enum flag {one, two}; | |
| enum flag endOfData, matchFound; | |
| endOfData = one; | |
| matchFound = one; | |
| if (endOfData == 0) | |
| { | |
| printf ("end of data is one"); |