Skip to content

Instantly share code, notes, and snippets.

View jhoughjr's full-sized avatar
🎯
Focusing

Jimmy Hough Jr. jhoughjr

🎯
Focusing
View GitHub Profile
if (UI_USER_INTERFACE_IDIOM() == UIUserInterfaceIdiomPad) {
setupForiPad();
}else{
setupForiPhone();
}
// this is where schemes are saved, so they can be created and saved automagically ;)
-(void) schemeWasCreated:(NSNotification*) notification
{
NSDictionary* dict = [notification userInfo];
PHColorScheme* createdScheme = dict[@"createdScheme"];
DLog(@"detected scheme creation for %@", [createdScheme name]);
// assume no dupes exist
@jhoughjr
jhoughjr / gist:4669644
Created January 30, 2013 01:00
only sets 1 as numberToAppend, cant see why. it seems ti should work.
// this is where schemes are saved, so they can be created and saved automagically ;)
-(void) schemeWasCreated:(NSNotification*) notification
{
NSDictionary* dict = [notification userInfo];
PHColorScheme* createdScheme = dict[@"createdScheme"];
DLog(@"detected scheme creation for %@", [createdScheme name]);
// assume no dupes exist
- (NSString *) findUniqueSaveNameForSchemeName:(NSString*)pathString
{
int i = 1;
NSString *path;
do {
// iterate until a name does not match an existing file
path = [NSString stringWithFormat:@"%@ %i",[pathString stringByDeletingPathExtension] , i++];
} while ([[NSFileManager defaultManager] fileExistsAtPath:path]);
return path;
@jhoughjr
jhoughjr / gist:4680512
Created January 31, 2013 05:30
needs some cleaning up still but compare this to the commented out imp.
//
// PHColorSchemeManager.m
// TrigPad
//
// Created by Jimmy Hough Jr on 3/9/11.
// Copyright 2011 PH Systems/Motech. All rights reserved.
//
#import "PHColorSchemeManager.h"
@jhoughjr
jhoughjr / gist:4727918
Created February 7, 2013 02:26
What is this strange syntax?
- (UITableViewCell *)tableView:(UITableView *)tableView
cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
UITableViewCell* cell = [tableView dequeueReusableCellWithIdentifier:@"cell"];
if(cell == nil)
cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"cell"];
{
@jhoughjr
jhoughjr / gist:4748438
Created February 10, 2013 05:00
only see "Sine" even though the button is plenty large enough to fit both lines. WTF?
-(void) setupButtons
{
[super setupButtons];
for (UIView *view in [[self view] subviews]) {
if ([view isKindOfClass:[UIButton class]]) {
DLog(@"found buttin");
UIButton* button = (UIButton*)view;
@jhoughjr
jhoughjr / gist:4760356
Created February 12, 2013 05:03
logs from opening notes, creating one and going back home.
2013-02-11 23:01:53.373 Inspection[19041:c07] -[Notes loadView]
2013-02-11 23:02:00.995 Inspection[19041:c07] -[Notes done]
2013-02-11 23:02:00.996 Inspection[19041:c07] -[InspectionTable viewWillAppear:]
2013-02-11 23:02:00.997 Inspection[19041:c07] -[InspectionTable reloadData]
Hello Chris,
I hope your trip has gone well,I haven't heard form you in a while.
We have had a chance to look at the code in more detail, have discovered some things.
First, there were memory management warnings in the original source, around 7 of them if i recall.
We fixed those.
Our second finding is that this application is constructed in a very unorthodox way, means that debugging will not be a trivial endeavor, as I had believed when I hadn't looked as deeply at the code.
We can debug the 3 bugs, and we have found one crash inducing bug to date that we can fix, but we cannot do that at a fixed rate,
@jhoughjr
jhoughjr / gist:4774610
Created February 12, 2013 23:47
draft email to Chris
Hello Chris,
I hope your trip has gone well,I haven't heard form you in a while.
We have had a chance to look at the code in more detail, have discovered some things.
First, there were memory management warnings in the original source, around 7 of them if i recall.
We fixed those.
Our second finding is that this application is constructed in a very unorthodox way, means that debugging will not be a trivial endeavor, as I had believed when I hadn't looked as deeply at the code.
We can debug the 3 bugs, and we have found one crash inducing bug to date that we can fix, but we cannot do that at a fixed rate,