MD5: 59bab8f71f8c096cd3f72cd73851515d
Rename it to: Sublime Text
Make it executable with: chmod u+x Sublime\ Text
// When there are many controls, you can identify each control by giving them an unique tag property | |
// and use the following code to locate the control | |
// | |
// Return the button with the specified ID (as tag) | |
// | |
- (UIButton*) getButton:(int)idButton | |
{ | |
return [self.view viewWithTag:idButton]; | |
} |
// NSString+StringExtension.h | |
// | |
#import <Foundation/Foundation.h> | |
@interface NSString (StringExtension) | |
// Trim off leading and trailing whitespaces | |
// | |
-(NSString*) trim; |
// UIImage+UIImageExtension.h | |
// | |
#import <Foundation/Foundation.h> | |
@interface UIImage (UIImageExtension) | |
// Resample to create another image: aspect ratio is not preserved (not yet) | |
// | |
- (UIImage *)resample:(CGSize)newSize; |
// ArchiveHelper.h | |
// | |
@interface ArchiveHelper : NSObject | |
+ (id)loadObjectFromFile:(NSString*)filePath withKey:(NSString*)key; | |
+ (void)saveObject:(id)object toFile:(NSString*)filePath withKey:(NSString*)key; | |
@end |
#import <Foundation/Foundation.h> | |
// Provides Path undrer "Documents" | |
// | |
@interface DocumentPathBuilder : NSObject | |
@property (nonatomic, copy, readonly) NSString* documentFolder; | |
// Given a 'relative' filePath, return its absolute path under documents folder | |
// |
//-------------------------------------------------------------- | |
// To add a row | |
//-------------------------------------------------------------- | |
// TODO: append one row to self.dataArray | |
// | |
NSIndexPath* indexPath = [NSIndexPath indexPathForRow:self.dataArray.numberOfItems - 1 inSection:0]; | |
[self.tableView insertRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] |
// TODO: pathForResource:@"Party.xml" ofType:nil should work. | |
// If so, then we can extract Party.xml as parameter. Better, we can add a path parameters, so that the file is stored | |
// to <DocumentPath>/data/<someFile> | |
// | |
+ (NSString *)dataFilePath:(BOOL)forSave { | |
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, | |
NSUserDomainMask, YES); | |
NSString *documentsDirectory = [paths objectAtIndex:0]; | |
NSString *documentsPath = [documentsDirectory |