github
Advanced Search
  • Home
  • Pricing and Signup
  • Explore GitHub
  • Blog
  • Login

yfactorial / objectiveresource

  • Admin
  • Watch Unwatch
  • Fork
  • Your Fork
  • Pull Request
  • Download Source
    • 423
    • 47
  • Source
  • Commits
  • Network (47)
  • Issues (0)
  • Downloads (3)
  • Wiki (1)
  • Graphs
  • Branch: 1.1

click here to add a description

click here to add a homepage

  • Branches (6)
    • 1.1 ✓
    • category_based
    • decimal_and_int_demo
    • gh-pages
    • master
    • origin/decimal_and_int_demo
  • Tags (3)
    • class_inheritence
    • 1.01
    • 1.0
Sending Request…
Enable Donations

Pledgie Donations

Once activated, we'll place the following badge in your repository's detail box:
Pledgie_example
This service is courtesy of Pledgie.

A port of Ruby on Rails' ActiveResource to Objective-C (and specifically the iPhone) — Read more

  cancel

http://iphoneonrails.com

  cancel
  • Private
  • Read-Only
  • HTTP Read-Only

This URL has Read+Write access

refs #73 fix memory leak Comment
Joshua Vickery (author)
Fri Oct 09 14:29:49 -0700 2009
commit  e17cf52433b22e5b502bf3584d10b3ae38439e62
tree    3c40e2023aecc4dfc5e565484688c459d964ad5a
parent  3f66735d664c9e358774669d727db7be0a697735
objectiveresource / Classes / lib / ConnectionManager.m Classes/lib/ConnectionManager.m
100644 88 lines (71 sloc) 1.844 kb
edit raw blame history
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
//
// ConnectionManager.m
//
// Created by Adam Alexander on 2/28/09.
// Copyright 2009 yFactorial, LLC. All rights reserved.
//
 
#import "ConnectionManager.h"
 
 
@implementation ConnectionManager
@synthesize operationQueue;
 
- (void)cancelAllJobs {
[operationQueue cancelAllOperations];
}
 
- (void) runJob:(SEL)selector onTarget:(id)target {
[self runJob:selector onTarget:target withArgument:nil];
}
 
- (void) runJob:(SEL)selector onTarget:(id)target withArgument:(id)argument {
    NSInvocationOperation *operation = [[NSInvocationOperation alloc] initWithTarget:target selector:selector object:argument];
    [operationQueue addOperation:operation];
[operation release];
}
 
- (id)init {
    if ( self = [super init] ) {
self.operationQueue = [[[NSOperationQueue alloc] init] autorelease];
[operationQueue setMaxConcurrentOperationCount:1];
return self;
    } else {
return nil;
}
}
 
#pragma mark Standard Singleton Plumbing
 
static ConnectionManager *sharedConnectionManager = nil;
 
+ (ConnectionManager *)sharedInstance
{
    @synchronized(self) {
        if (sharedConnectionManager == nil) {
            [[self alloc] init]; // assignment not done here
        }
    }
    return sharedConnectionManager;
}
 
+ (id)allocWithZone:(NSZone *)zone
{
    @synchronized(self) {
        if (sharedConnectionManager == nil) {
            sharedConnectionManager = [super allocWithZone:zone];
            return sharedConnectionManager; // assignment and return on first allocation
        }
    }
    return nil; //on subsequent allocation attempts return nil
}
 
- (id)copyWithZone:(NSZone *)zone
{
    return self;
}
 
- (id)retain
{
    return self;
}
 
- (unsigned)retainCount
{
    return UINT_MAX; //denotes an object that cannot be released
}
 
- (void)release
{
    //do nothing
}
 
- (id)autorelease
{
    return self;
}
@end
 
Blog | Support | Training | Contact | API | Status | Twitter | Help | Security
© 2010 GitHub Inc. All rights reserved. | Terms of Service | Privacy Policy
Powered by the Dedicated Servers and
Cloud Computing of Rackspace Hosting®
Dedicated Server