Skip to content

Instantly share code, notes, and snippets.

@cpreston
cpreston / Non Universal (iPhone OR iPad)
Last active August 29, 2015 13:59
Xibs instead of StoryboardsAppDelegate.m
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
// Override point for customization after application launch.
MainViewController *mainViewController = [[MainViewController alloc] init];
self.window.rootViewController = mainViewController;
[self.window makeKeyAndVisible];
return YES;
}
@cpreston
cpreston / in Flash:
Created April 11, 2014 17:55
Call action script from javascript
if(ExternalInterface.available)
{
ExternalInterface.addCallback("callFlashFromJS", addBooks);
}
@cpreston
cpreston / cellForRowAtIndexPath method
Last active May 20, 2016 15:08
basic cellForRowAtIndexPath method
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"myCell"];
if (cell == nil) {
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:@"myCell"];
cell.selectionStyle = UITableViewCellSelectionStyleNone;
}
cell.textLabel.text = self.justCourseNamesArray[indexPath.row];
# BasicCoreData is the app name
# Note is the model name
# Private is the directory for the machine-generated files
cd BasicCoreData/Models
mogenerator -m Note.xcdatamodeld/Note.xcdatamodel --machine-dir Private --template-var arc=true