#Week 3 - Foundation
Last week we covered over bootstrap and some mobile design patterns, this week will cover Foundation framework and how we can use that.
/* Can be called from any thread */ | |
- (void)managedObjectContextDidSave:(NSNotification *)note | |
{ | |
// FIX: you must mergeChangesFromContextDidSaveNotification: on main thread | |
// handling the notification occurs on background thread. | |
// it needs to "merge" on the main thread. | |
// From: http://benford.me/blog/2012/5/7/an-observer-of-nsmanagedobjectcontextdidsavenotification-html | |
NSManagedObjectContext *context = (NSManagedObjectContext *)note.object; | |
if( context.persistentStoreCoordinator == managedObjectContext.persistentStoreCoordinator ){ |
/** | |
*The following mimics thefunctionality of showDialog in how to call the function but instead of using the method | |
* to know what dialog to show we use the passed method name to check for that permssion e.g. "email". | |
*/ | |
// In www/facebook-native.js | |
exports.checkPermissions = function checkPermissions (options, s, f) { | |
exec(s, f, 'FacebookConnectPlugin', 'checkPermissions', [options]) | |
} |
/** | |
*The following mimics thefunctionality of showDialog in how to call the function but instead of using the method | |
* to know what dialog to show we use the passed method name to check for that permssion e.g. "email". | |
*/ | |
// In www/facebook-native.js | |
exports.checkHasCorrectPermissions = function checkHasCorrectPermissions (s, f) { | |
exec(s, f, 'FacebookConnectPlugin', 'checkHasCorrectPermissions', []) | |
} |
#pragma mark - Table View Data Source | |
- (NSInteger)tableView:(UITableView *)tableView | |
numberOfRowsInSection:(NSInteger)section | |
{ | |
return 0; | |
} | |
- (UITableViewCell *)tableView:(UITableView *)tableView | |
cellForRowAtIndexPath:(NSIndexPath *)indexPath | |
{ |
console.log("hello CRC16"); | |
function CreateCrc16(){ | |
var polynomial,value,temp; | |
var table=new Array(256); | |
polynomial=40961; | |
for(i=0;i<table.length;++i){ | |
value=0;temp=i; |