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
| function saveContact( row ){ | |
| var form = $.tmpl(templates["contact-form"]), | |
| valid = true, | |
| messages = [], | |
| dfd = $.Deferred(); | |
| /* | |
| bunch of client-side validation here | |
| */ | |
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
| jQuery UI MultiSelect Widget: | |
| http://www.erichynds.com/examples/jquery-ui-multiselect-widget/demos/ |
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
| The po command stands for "print object." | |
| The symbol $eax refers to one of the CPU registers. In the case of an exception, this register will contain a pointer to the NSException object. | |
| Note: $eax only works for the simulator, if you’re debugging on the device you’ll need to use register $r0. | |
| (lldb) po [$eax class] | |
| You will see something like this: | |
| (id) $2 = 0x01446e84 NSException | |
| You can call any method from NSException on this object. For example: |
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
| Reachability *reachability = [Reachability reachabilityForInternetConnection]; | |
| NetworkStatus internetStatus = [reachability currentReachabilityStatus]; | |
| if(internetStatus == NotReachable) { | |
| UIAlertView *errorView; | |
| errorView = [[UIAlertView alloc] | |
| initWithTitle: NSLocalizedString(@"Network error", @"Network error") | |
| message: NSLocalizedString(@"No internet connection found, this application requires an internet connection to gather the data required.", @"Network error") | |
| delegate: self |
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
| NSURLCache *sharedCache = [[NSURLCache alloc] initWithMemoryCapacity:0 diskCapacity:0 diskPath:nil]; | |
| [NSURLCache setSharedURLCache:sharedCache]; | |
| sharedCache = nil; | |
| Reference: http://www.iphonedevsdk.com/forum/iphone-sdk-development/52972-cfdata-memory-problem.html |
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
| .inputtext { | |
| background-color: #FFFFEC; | |
| border: 1px solid #ECECFF; | |
| border-radius: 5px 5px 5px 5px; | |
| box-shadow: -1px 0 8px -5px #000000; | |
| font-size: 14px; | |
| } | |
| .inputtext:hover, .inputtext:focus { | |
| background-color: #FFFFFF; | |
| border: 1px solid #56B4EF; |
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
| <html ng-app="myApp"> | |
| <head> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.1/jquery.min.js"></script> | |
| <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.23/jquery-ui.min.js"></script> | |
| <script type="text/javascript" ng:autobind src="http://code.angularjs.org/1.0.2/angular.js"></script> | |
| <link type="text/css" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.12/themes/redmond/jquery-ui.css" rel="stylesheet" /> | |
| <script type="text/javascript"> | |
| function MyController() { | |
| this.years = "1950"; |
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
| // in the AppDelegate.m, add the following code to the method application:didFinishLaunchingWithOptions | |
| NSURL *ubiq = [[NSFileManager defaultManager] URLForUbiquityContainerIdentifier:nil]; | |
| if (ubiq) { | |
| NSLog(@"iCloud access at %@", ubiq); | |
| // TODO: Load document... | |
| } else { | |
| NSLog(@"No iCloud access"); | |
| } |
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
| - (void)tableView:(UITableView *)theTableView | |
| didSelectRowAtIndexPath:(NSIndexPath *)newIndexPath { | |
| [theTableView deselectRowAtIndexPath:[theTableView indexPathForSelectedRow] animated:NO]; | |
| UITableViewCell *cell = [theTableView cellForRowAtIndexPath:newIndexPath]; | |
| if (cell.accessoryType == UITableViewCellAccessoryNone) { | |
| cell.accessoryType = UITableViewCellAccessoryCheckmark; | |
| // Reflect selection in data model | |
| } else if (cell.accessoryType == UITableViewCellAccessoryCheckmark) { | |
| cell.accessoryType = UITableViewCellAccessoryNone; |
OlderNewer