Skip to content

Instantly share code, notes, and snippets.

Edward Chiang edwardinubuntu

Block or report user

Report or block edwardinubuntu

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@edwardinubuntu
edwardinubuntu / gist:758215
Created Dec 29, 2010
Application Did Finish Launching
View gist:758215
- (void)applicationDidFinishLaunching:(UIApplication *)application {
// ... do things
}
@edwardinubuntu
edwardinubuntu / gist:758216
Created Dec 29, 2010
First view Controller push
View gist:758216
// ... do things
navController = [[UINavigationControlleralloc] init];
FirstViewController *firstViewController=
[[FirstViewControlleralloc] init];
firstViewController.title = @"First";
[navController pushViewController:firstViewController animated:NO];
[firstViewController release];
[windowaddSubview:navController.view];
// ... do things
@edwardinubuntu
edwardinubuntu / gist:758218
Created Dec 29, 2010
Second push View Controller
View gist:758218
// ... do things
SecondViewController *secondViewController =
[[SecondViewControlleralloc] init];
secondViewController.title = @"Second";
[self.navigationController pushViewController:
secondViewController animated:YES];
[secondViewController release];
@edwardinubuntu
edwardinubuntu / gist:758219
Created Dec 29, 2010
Third Push View Controller
View gist:758219
// ... do things
ThirdViewController *thirdViewController =
[[ThirdViewController alloc] init];
[self.navigationController
pushViewController:thirdViewController animated:YES];
[thirdViewController release];
// ... do things
@edwardinubuntu
edwardinubuntu / gist:758233
Created Dec 29, 2010
textFile conformsToProtocol
View gist:758233
TextFile*textFile = [[TextFile alloc] init];
if ( [ textFile conformsToProtocol:@protocol(Document) ] == YES) {
// do something
}
@edwardinubuntu
edwardinubuntu / gist:758236
Created Dec 29, 2010
newDocument conformsToProtocol
View gist:758236
-(BOOL) addDocument:(id) newDocument {
if ( [newDocument conformsToProtocol:@protocol(Document)]){
// add the document...
returnYES;
} else
return NO;
}
@edwardinubuntu
edwardinubuntu / gist:758286
Created Dec 29, 2010
setWidthHeight selector
View gist:758286
SEL setWidthHeight;
setWidthHeight = @selector(setWidth:height:);
@edwardinubuntu
edwardinubuntu / gist:758287
Created Dec 29, 2010
myButtonCell selector
View gist:758287
[myButtonCell setAction:@selector(reapTheWInd:)];
[myButtonCell setTarget:anObject];
View gist:763197
/*
* kCLLocationAccuracy<x>
*
* Discussion:
* Used to specify the accuracy level desired.
* The location service will try its best to achieve
* your desired accuracy. However, it is not guaranteed.
* To optimize power performance,
* be sure to specify an appropriate accuracy for your usage scenario
* eg, use a large accuracy value when only a coarse location is needed.
@edwardinubuntu
edwardinubuntu / gist:763216
Created Jan 3, 2011
locationManager:didUpdateToLocation:newLocation:
View gist:763216
/*
* locationManager:didUpdateToLocation:fromLocation:
*
* Discussion:
* Invoked when a new location is available.
* oldLocation may be nil if there is no previous location
* available.
*/
- (void)locationManager:(CLLocationManager *)manager
didUpdateToLocation:(CLLocation *)newLocation
You can’t perform that action at this time.