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)respondToNotification:(NSNotification *)notification { | |
if (![NSThread isMainThread]) { | |
[self performSelectorOnMainThread:@selector(respondToNotification:) withObject:notification waitUntilDone:YES]; | |
return; | |
} | |
//Code 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
private static string RenderPartialViewToString(Controller controller, string pathToView, object viewModel, | |
ViewDataDictionary viewData = null) { | |
String result; | |
var viewEngine = ViewEngines.Engines.FindPartialView(controller.ControllerContext, pathToView); | |
using (var writer = new StringWriter()) { | |
var vd = viewData == null ? new ViewDataDictionary(viewModel) | |
: new ViewDataDictionary(viewData) { Model = viewModel }; | |
var viewContext = new ViewContext(controller.ControllerContext, | |
viewEngine.View, |
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
require.config({ | |
paths: { | |
//3rd Party libraries | |
'knockout': 'knockout-2.2.0.debug', | |
'jquery': 'jquery-1.7.1', | |
'doubletap': 'jquery.doubletap', | |
'address': 'jquery.address-1.4.min', | |
'bootstrap': 'bootstrap-2.0.1', | |
'amplify': 'amplify', | |
'JQueryDictionary": "Utilities/JQueryDictionary', |
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
/* print a CFNumber */ | |
void printCfNumber(CFNumberRef cfNum) { | |
SInt32 s; | |
if(!CFNumberGetValue(cfNum, kCFNumberSInt32Type, &s)) { | |
printf("***CFNumber overflow***"); | |
return; | |
} | |
printf("%d", (int)s); | |
} |
NewerOlder