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
| // | |
| // OutletActionDemoViewController.h | |
| // OutletActionDemo | |
| // | |
| // Created by Eric Knapp on 6/15/10. | |
| // Copyright __MyCompanyName__ 2010. All rights reserved. | |
| // | |
| #import <UIKit/UIKit.h> |
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
| // | |
| // OutletActionDemoViewController.m | |
| // OutletActionDemo | |
| // | |
| // Created by Eric Knapp on 6/15/10. | |
| // Copyright __MyCompanyName__ 2010. All rights reserved. | |
| // | |
| #import "OutletActionDemoViewController.h" |
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
| Steps for making an Action (In Xcode 3!) | |
| 1. Open the .h file of the view controller. | |
| 2. After all properties, create a method declaration | |
| with "IBAction" as return value. | |
| -(IBAction)clickTheButton; | |
| 3. Copy the method declaration and switch to .m file. | |
| 4. Paste into .m file, remove semi-colon, add braces. | |
| 5. Code as needed. | |
| 6. Save .h and .m files. |
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
| Set the text of a UILabel from code. | |
| 1. Open the view controller .m file. | |
| 2. Uncomment the "viewDidLoad" method. | |
| 3. Set the text property of the label. | |
| self.myLabel.text = @"Hello, world."; |
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
| Steps for making Outlets (in Xcode 3!) | |
| 1. Open the view controller .h file. (In Class group.) | |
| 2. Add a property | |
| 1. Make an instance variable of UILabel type. | |
| UILabel *myLabel; | |
| 2. Make a property for the ivar. | |
| 3. Make property an IBOutlet | |
| @property (nonatomic, retain) IBOutlet UILabel *myLabel; |
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
| // | |
| // Dog.m | |
| // FirstCL | |
| // | |
| // Created by Eric Knapp on 6/14/10. | |
| // Copyright 2010 __MyCompanyName__. All rights reserved. | |
| // | |
| #import "Dog.h" |
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
| // | |
| // Dog.h | |
| // FirstCL | |
| // | |
| // Created by Eric Knapp on 6/14/10. | |
| // Copyright 2010 __MyCompanyName__. All rights reserved. | |
| // | |
| #import <Cocoa/Cocoa.h> |
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
| Steps to create an outlet with a class I wrote. | |
| Example for SomeShinyClass | |
| In the .h file: | |
| 1. @class SomeShinyClass; | |
| 2. Instance variable | |
| • SomeShinyClass *someShiny; |
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
| // Remove words | |
| -(void)removeWordAtIndex:(NSUInteger)index { | |
| [self.wordList removeObjectAtIndex:index]; | |
| [self saveWordListToFileSystem]; | |
| } |
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
| // Deserialize json and add to Core Data | |
| #import "CJSONDeserializer.h" | |
| #import "CJSONSerializer.h" | |
| /* | |
| The JSON lib is found here: http://code.google.com/p/json-framework/ | |
| */ | |
| - (void)processNewMessagesData:(NSString *)jsonMessages { |