Skip to content

Instantly share code, notes, and snippets.

View lappp9's full-sized avatar

Luke Parham lappp9

View GitHub Profile
- (void)setObject:(id)object forKey:(NSString *)key
{
dispatch_barrier_async(_dispatch_queue, ^{
_cache[key] = object;
});
}
- (id)objectForKey:(NSString *)key
{
__block id object;
_dispatch_queue = dispatch_queue_create("com.Experiments.Cache", DISPATCH_QUEUE_CONCURRENT);
_dispatch_queue = dispatch_queue_create("com.Experiments.Cache", DISPATCH_QUEUE_SERIAL);
- (void)setObject:(id)object forKey:(NSString *)key
{
[_lock lock];
_cache[key] = object;
[_lock unlock];
}
- (id)objectForKey:(NSString *)key
{
id object;
- (void)setObject:(id)object forKey:(NSString *)key
{
dispatch_sync(_dispatch_queue, ^{
_cache[key] = object;
});
}
- (id)objectForKey:(NSString *)key
{
__block id object;
- (void)setObject:(id)object forKey:(NSString *)key
{
PERF::MutexLocker l(__instanceLock__);
_cache[key] = object;
}
- (id)objectForKey:(NSString *)key
{
PERF::MutexLocker l(__instanceLock__);
- (void)setObject:(id)object forKey:(NSString *)key
{
@synchronized (_cache) {
_cache[key] = object;
}
}
- (id)objectForKey:(NSString *)key
{
id object;
- (void)tableView:(UITableView *)tableView willDisplayCell:(UITableViewCell *)cell forRowAtIndexPath:(NSIndexPath *)indexPath
{
CustomTableViewCell *tableViewCell = (CustomTableViewCell *)cell;
// Check to see if table is in neutral position. If so, bail for offscreen cells
if (_tableView.contentOffset.y == DEFAULT_Y_OFFSET && cell.frame.origin.y > self.view.bounds.size.height) {
return;
}
// Do Content-Loading For Cell
lipo -create -output 
      <build-location>/<framework-name>.framework/<framework-name> 
      <build-location>/build/Build/Products/Release-iphoneos/<framework-name>.framework/
      <framework-name> <build-location>/build/Build/Products/Release-iphonesimulator/<framework-name>.framework/<framework-name>
xcodebuild -workspace <workspace-name> -scheme <target-name> -configuration 'Release' -derivedDataPath <build-location>