Skip to content

Commit

Permalink
Eliminated requirement to use -all_load linker flag. Fixed breakage i…
Browse files Browse the repository at this point in the history
…n OS X builds due to ivar/property name disagreement. Removed references to all_load from the install docs. fixes RestKit#239
  • Loading branch information
blakewatters committed Sep 2, 2011
1 parent 7ca39d8 commit b96940c
Show file tree
Hide file tree
Showing 31 changed files with 107 additions and 2,717 deletions.
3 changes: 3 additions & 0 deletions Code/CoreData/NSManagedObject+ActiveRecord.m
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@
#import "NSManagedObject+ActiveRecord.h"
#import "RKObjectManager.h"
#import "RKLog.h"
#import "../Support/RKFixCategoryBug.h"

RK_FIX_CATEGORY_BUG(NSManagedObject_ActiveRecord)

// Set Logging Component
#undef RKLogComponent
Expand Down
3 changes: 3 additions & 0 deletions Code/CoreData/RKObjectPropertyInspector+CoreData.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@
#import <CoreData/CoreData.h>
#import "RKObjectPropertyInspector+CoreData.h"
#import "../Support/RKLog.h"
#import "../Support/RKFixCategoryBug.h"

RK_FIX_CATEGORY_BUG(RKObjectPropertyInspector_CoreData)

// Set Logging Component
#undef RKLogComponent
Expand Down
5 changes: 4 additions & 1 deletion Code/Network/NSData+MD5.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
// Copyright 2011 Two Toasters. All rights reserved.
//

#import "NSData+MD5.h"
#import <CommonCrypto/CommonDigest.h>
#import "NSData+MD5.h"
#import "../Support/RKFixCategoryBug.h"

RK_FIX_CATEGORY_BUG(NSData_MD5)

@implementation NSData (MD5)

Expand Down
3 changes: 3 additions & 0 deletions Code/Network/NSDictionary+RKRequestSerialization.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
//

#import "NSDictionary+RKRequestSerialization.h"
#import "../Support/RKFixCategoryBug.h"

RK_FIX_CATEGORY_BUG(NSDictionary_RKRequestSerialization)

/**
* private helper function to convert any object to its string representation
Expand Down
5 changes: 4 additions & 1 deletion Code/Network/NSString+MD5.m
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,11 @@
// Copyright 2011 Two Toasters. All rights reserved.
//

#import "NSString+MD5.h"
#import <CommonCrypto/CommonDigest.h>
#import "NSString+MD5.h"
#import "../Support/RKFixCategoryBug.h"

RK_FIX_CATEGORY_BUG(NSString_MD5)

@implementation NSString (MD5)

Expand Down
1 change: 1 addition & 0 deletions Code/Network/RKClient.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ NSString* RKPathAppendQueryParams(NSString* resourcePath, NSDictionary* queryPar
NSString* _serviceUnavailableAlertTitle;
NSString* _serviceUnavailableAlertMessage;
BOOL _serviceUnavailableAlertEnabled;
RKRequestQueue *_requestQueue;
RKRequestCache* _cache;
RKRequestCachePolicy _cachePolicy;
NSMutableSet *_additionalRootCertificates;
Expand Down
1 change: 1 addition & 0 deletions Code/Network/RKRequest.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,7 @@ typedef enum RKRequestBackgroundPolicy {
BOOL _forceBasicAuthentication;
RKRequestCache* _cache;
NSTimeInterval _cacheTimeoutInterval;
RKRequestQueue *_queue;

#if TARGET_OS_IPHONE
RKRequestBackgroundPolicy _backgroundPolicy;
Expand Down
1 change: 1 addition & 0 deletions Code/Network/RKRequestQueue.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
* for dispatching and managing RKRequest objects
*/
@interface RKRequestQueue : NSObject {
NSString *_name;
NSMutableArray* _requests;
NSObject<RKRequestQueueDelegate>* _delegate;
NSUInteger _loadingCount;
Expand Down
4 changes: 4 additions & 0 deletions Code/Network/RKRequestQueue.m
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,11 @@
#import "RKResponse.h"
#import "RKNotifications.h"
#import "../Support/RKLog.h"
#import "../Support/RKFixCategoryBug.h"

RK_FIX_CATEGORY_BUG(UIApplication_RKNetworkActivity)

// Constants
static RKRequestQueue* RKRequestQueueSharedQueue = nil;
static NSMutableArray* RKRequestQueueInstances = nil;

Expand Down
3 changes: 3 additions & 0 deletions Code/Support/NSDictionary+RKAdditions.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
//

#import "NSDictionary+RKAdditions.h"
#import "RKFixCategoryBug.h"

RK_FIX_CATEGORY_BUG(NSDictionary_RKAdditions)

@implementation NSDictionary (RKAdditions)

Expand Down
3 changes: 3 additions & 0 deletions Code/Support/NSString+InflectionSupport.m
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@
//

#import "NSString+InflectionSupport.h"
#import "RKFixCategoryBug.h"

RK_FIX_CATEGORY_BUG(NSString_InflectionSupport)

@implementation NSString (InflectionSupport)

Expand Down
2 changes: 1 addition & 1 deletion Code/Support/NSString+RestKit.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
A library of helpful additions to the NSString class to simplify
common tasks within RestKit
*/
@interface NSString (NSString)
@interface NSString (RestKit)

/**
Returns a resource path with a dictionary of query parameters URL encoded and appended
Expand Down
3 changes: 3 additions & 0 deletions Code/Support/NSString+RestKit.m
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@

#import "NSString+RestKit.h"
#import "../Network/RKClient.h"
#import "RKFixCategoryBug.h"

RK_FIX_CATEGORY_BUG(NSString_RestKit)

@implementation NSString (RestKit)

Expand Down
23 changes: 23 additions & 0 deletions Code/Support/RKFixCategoryBug.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// RKCategoryFix.h
// RestKit
//
// Created by Blake Watters on 9/1/11.
// Copyright (c) 2011 RestKit. All rights reserved.
//

#ifndef RestKit_RKCategoryFix_h
#define RestKit_RKCategoryFix_h

/**
Add this macro before each category implementation, so we don't have to use
-all_load or -force_load to load object files from static libraries that only contain
categories and no classes.
See http://developer.apple.com/library/mac/#qa/qa2006/qa1490.html for more info.
Shamelessly borrowed from Three20
*/
#define RK_FIX_CATEGORY_BUG(name) @interface RK_FIX_CATEGORY_BUG##name @end \
@implementation RK_FIX_CATEGORY_BUG##name @end

#endif
8 changes: 5 additions & 3 deletions Examples/RKCatalog/RKCatalog.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@
2501DEAD13607B74003DE9E4 /* libRestKitXMLParserLibxml.a */,
2501DEAF13607B74003DE9E4 /* libRestKitCoreData.a */,
2501DEB113607B74003DE9E4 /* libRestKitThree20.a */,
2501DEB313607B74003DE9E4 /* UISpec.app */,
2501DEB313607B74003DE9E4 /* RestKitSpecs.app */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -533,10 +533,10 @@
remoteRef = 2501DEB013607B74003DE9E4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
2501DEB313607B74003DE9E4 /* UISpec.app */ = {
2501DEB313607B74003DE9E4 /* RestKitSpecs.app */ = {
isa = PBXReferenceProxy;
fileType = wrapper.application;
path = UISpec.app;
path = RestKitSpecs.app;
remoteRef = 2501DEB213607B74003DE9E4 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
Expand Down Expand Up @@ -704,6 +704,7 @@
"\"$(SOURCE_ROOT)/../../Build/$(BUILD_STYLE)-$(PLATFORM_NAME)\"",
"\"$(SRCROOT)\"",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -721,6 +722,7 @@
"\"$(SOURCE_ROOT)/../../Build/$(BUILD_STYLE)-$(PLATFORM_NAME)\"",
"\"$(SRCROOT)\"",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
VALIDATE_PRODUCT = YES;
WRAPPER_EXTENSION = app;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1114,7 +1114,7 @@
25A7B1DB13421D28004816AA /* libRestKitXMLParserLibxml.a */,
A7A2D3B512D7822D00683D6F /* libRestKitCoreData.a */,
A7A2D3B712D7822D00683D6F /* libRestKitThree20.a */,
A7A2D3B912D7822D00683D6F /* UISpec.app */,
A7A2D3B912D7822D00683D6F /* RestKitSpecs.app */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -1248,10 +1248,10 @@
remoteRef = A7A2D3B612D7822D00683D6F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
A7A2D3B912D7822D00683D6F /* UISpec.app */ = {
A7A2D3B912D7822D00683D6F /* RestKitSpecs.app */ = {
isa = PBXReferenceProxy;
fileType = wrapper.application;
path = UISpec.app;
path = RestKitSpecs.app;
remoteRef = A7A2D3B812D7822D00683D6F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
Expand Down Expand Up @@ -1378,10 +1378,7 @@
"\"$(SRCROOT)/Libraries/three20\"",
"\"$(SRCROOT)\"",
);
OTHER_LDFLAGS = (
"-all_load",
"-ObjC",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "Discussion Board";
VALIDATE_PRODUCT = YES;
};
Expand All @@ -1401,10 +1398,7 @@
../../../Build,
Libraries/three20/Build/Products/three20,
);
OTHER_LDFLAGS = (
"-all_load",
"-ObjC",
);
OTHER_LDFLAGS = "-ObjC";
SDKROOT = iphoneos;
};
name = Debug;
Expand Down
18 changes: 7 additions & 11 deletions Examples/RKMacOSX/RKMacOSX.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@
25D63964135184F1000879B1 /* libRestKitXMLParserLibxml.a */,
25D63966135184F1000879B1 /* libRestKitCoreData.a */,
25D63968135184F1000879B1 /* libRestKitThree20.a */,
25D6396A135184F1000879B1 /* UISpec.app */,
25D6396A135184F1000879B1 /* RestKitSpecs.app */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -367,10 +367,10 @@
remoteRef = 25D63967135184F1000879B1 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
25D6396A135184F1000879B1 /* UISpec.app */ = {
25D6396A135184F1000879B1 /* RestKitSpecs.app */ = {
isa = PBXReferenceProxy;
fileType = wrapper.application;
path = UISpec.app;
path = RestKitSpecs.app;
remoteRef = 25D63969135184F1000879B1 /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
Expand Down Expand Up @@ -459,10 +459,7 @@
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
ONLY_ACTIVE_ARCH = YES;
OTHER_LDFLAGS = (
"-ObjC",
"-all_load",
);
OTHER_LDFLAGS = "-ObjC";
SDKROOT = macosx;
};
name = Debug;
Expand All @@ -477,10 +474,7 @@
GCC_WARN_ABOUT_RETURN_TYPE = YES;
GCC_WARN_UNUSED_VARIABLE = YES;
MACOSX_DEPLOYMENT_TARGET = 10.6;
OTHER_LDFLAGS = (
"-ObjC",
"-all_load",
);
OTHER_LDFLAGS = "-ObjC";
SDKROOT = macosx;
};
name = Release;
Expand All @@ -499,6 +493,7 @@
"$(inherited)",
"\"$(SRCROOT)\"",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand All @@ -518,6 +513,7 @@
"$(inherited)",
"\"$(SRCROOT)\"",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = "$(TARGET_NAME)";
WRAPPER_EXTENSION = app;
};
Expand Down
16 changes: 5 additions & 11 deletions Examples/RKTwitter/RKTwitter.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,7 @@
250AC4AE1358C79C006F084F /* libRestKitXMLParserLibxml.a */,
250AC4B01358C79C006F084F /* libRestKitCoreData.a */,
250AC4B21358C79C006F084F /* libRestKitThree20.a */,
250AC4B41358C79C006F084F /* UISpec.app */,
250AC4B41358C79C006F084F /* RestKitSpecs.app */,
);
name = Products;
sourceTree = "<group>";
Expand Down Expand Up @@ -399,10 +399,10 @@
remoteRef = 250AC4B11358C79C006F084F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
250AC4B41358C79C006F084F /* UISpec.app */ = {
250AC4B41358C79C006F084F /* RestKitSpecs.app */ = {
isa = PBXReferenceProxy;
fileType = wrapper.application;
path = UISpec.app;
path = RestKitSpecs.app;
remoteRef = 250AC4B31358C79C006F084F /* PBXContainerItemProxy */;
sourceTree = BUILT_PRODUCTS_DIR;
};
Expand Down Expand Up @@ -469,10 +469,7 @@
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../Build";
INFOPLIST_FILE = "Resources/RKTwitter-Info.plist";
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = (
"-all_load",
"-ObjC",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = RKTwitter;
};
name = Debug;
Expand All @@ -488,10 +485,7 @@
HEADER_SEARCH_PATHS = "$(SRCROOT)/../../Build";
INFOPLIST_FILE = "Resources/RKTwitter-Info.plist";
LIBRARY_SEARCH_PATHS = "$(inherited)";
OTHER_LDFLAGS = (
"-all_load",
"-ObjC",
);
OTHER_LDFLAGS = "-ObjC";
PRODUCT_NAME = RKTwitter;
VALIDATE_PRODUCT = YES;
};
Expand Down
Loading

0 comments on commit b96940c

Please sign in to comment.