Skip to content
This repository has been archived by the owner on Jun 17, 2024. It is now read-only.

ARC enabled. #72

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -485,7 +485,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_ENABLE_OBJC_ARC = YES;
INFOPLIST_FILE = LiveSDKTestBed/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand All @@ -497,7 +497,7 @@
isa = XCBuildConfiguration;
buildSettings = {
ASSETCATALOG_COMPILER_APPICON_NAME = AppIcon;
CLANG_ENABLE_OBJC_ARC = NO;
CLANG_ENABLE_OBJC_ARC = YES;
INFOPLIST_FILE = LiveSDKTestBed/Info.plist;
IPHONEOS_DEPLOYMENT_TARGET = 6.0;
LD_RUNPATH_SEARCH_PATHS = "$(inherited) @executable_path/Frameworks";
Expand Down
2 changes: 1 addition & 1 deletion examples/LiveSDKTestBed/LiveSDKTestBed/LiveAppDelegate.h
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,6 @@

@property (strong, nonatomic) UIWindow *window;

- (UIViewController *) initUIViewController;
- (UIViewController *) ini_tUIViewController;

@end
16 changes: 5 additions & 11 deletions examples/LiveSDKTestBed/LiveSDKTestBed/LiveAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -32,20 +32,14 @@ @implementation LiveAppDelegate

@synthesize window = _window;

- (void)dealloc
{
[_window release];
[super dealloc];
}

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

// Override point for customization after application launch.
self.window.backgroundColor = [UIColor whiteColor];

UIViewController * myViewController = [self initUIViewController];
UIViewController * myViewController = [self ini_tUIViewController];
[self.window setRootViewController: myViewController];

[self.window makeKeyAndVisible];
Expand Down Expand Up @@ -91,16 +85,16 @@ - (void)applicationWillTerminate:(UIApplication *)application
*/
}

- (UIViewController *) initUIViewController
- (UIViewController *) ini_tUIViewController
{
NSString *device = [[UIDevice currentDevice] model];

if ([device hasPrefix:@"iPad"])
{
return [[[LiveServiceViewController_iPad alloc] initWithNibName:nil bundle:nil] autorelease];
return [[LiveServiceViewController_iPad alloc] initWithNibName:nil bundle:nil];
}
else {
return [[[LiveServiceViewController_iPhone alloc] initWithNibName:nil bundle:nil] autorelease];
return [[LiveServiceViewController_iPhone alloc] initWithNibName:nil bundle:nil];
}
}

Expand Down
20 changes: 3 additions & 17 deletions examples/LiveSDKTestBed/LiveSDKTestBed/LiveServiceViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,19 +41,6 @@ - (void)didReceiveMemoryWarning
// Release any cached data, images, etc that aren't in use.
}

- (void)dealloc
{
[liveClient release];
[outputView release];
[signInButton release];
[scopesTextField release];
[pathTextField release];
[destinationTextField release];
[jsonBodyTextView release];
[imgView release];
[super dealloc];
}

#pragma mark - Output handling
- (void) handleException:(id)exception
context:(NSString *)context
Expand Down Expand Up @@ -117,11 +104,10 @@ - (void) configureLiveClientWithScopes:(NSString *)scopeText
[NSException raise:NSInvalidArgumentException format:@"The CLIENT_ID value must be specified."];
}

self.liveClient = [[[LiveConnectClient alloc] initWithClientId:CLIENT_ID
self.liveClient = [[LiveConnectClient alloc] initWithClientId:CLIENT_ID
scopes:[scopeText componentsSeparatedByCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]]
delegate:self
userState:@"init"]
autorelease ];
userState:@"init"];
}

- (void) loginWithScopes:(NSString *)scopeText
Expand Down Expand Up @@ -246,7 +232,7 @@ - (IBAction)onClickUploadButton:(id)sender
NSString *path = [[NSBundle mainBundle] pathForResource:@"volvo_c70"
ofType:@"jpg"];

NSData *data = [[[NSData alloc]initWithContentsOfFile:path] autorelease];
NSData *data = [[NSData alloc]initWithContentsOfFile:path];

NSString *uploadPath = self.pathTextField.text;
if ([uploadPath isEqual:@""] ||
Expand Down
268 changes: 214 additions & 54 deletions examples/PhotoSky/PhotoSky.xcodeproj/project.pbxproj

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion examples/PhotoSky/PhotoSky/PSMainViewController.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


#import <UIKit/UIKit.h>
#import <LiveSDK/LiveConnectClient.h>
#import "LiveConnectClient.h" // #import <LiveSDK/LiveConnectClient.h>

@interface PSMainViewController : UIViewController<LiveAuthDelegate, LiveOperationDelegate>
{
Expand Down
2 changes: 1 addition & 1 deletion examples/PhotoSky/PhotoSky/PSSkyDriveObject.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@


#import <Foundation/Foundation.h>
#import <LiveSDK/LiveConnectClient.h>
#import "LiveConnectClient.h" // #import <LiveSDK/LiveConnectClient.h>

@class PSSkyDriveObject;

Expand Down
13 changes: 13 additions & 0 deletions examples/PhotoSky/PhotoSky/PSSkyPhotoViewer.m
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,17 @@ @implementation PSSkyPhotoViewer
@synthesize currentFolder;
@synthesize currentModal;

+ (void) setEdgesForExtendedLayout:(UIViewController *)ctrl {
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Wundeclared-selector"
#pragma clang diagnostic ignored "-Wdeprecated"
// http://www.ifun.cc/blog/2014/02/08/gua-pei-ios7kai-fa-1/
if ([ctrl respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {
[ctrl setEdgesForExtendedLayout:UIRectEdgeNone];
}
#pragma clang diagnostic pop
}

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
Expand All @@ -63,6 +74,8 @@ - (void)didReceiveMemoryWarning
- (void)viewDidLoad
{
[super viewDidLoad];

[[self class] setEdgesForExtendedLayout:self];

self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]
initWithBarButtonSystemItem:UIBarButtonSystemItemDone
Expand Down
Loading