This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @implementation OCMockObject (TestUtils) | |
| + (id)classMockForClass:(Class)class { | |
| Class meta = object_getClass(class); | |
| return [self mockForClass:meta]; | |
| } | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @interface MyController () | |
| - (void)doA ; | |
| @end | |
| @implementation MyController | |
| - (void)doB{ doA(); } | |
| - (void)doA{ } | |
| @end |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| @implementation ClassMockTest | |
| @synthesize mockAlert = mockAlert_; | |
| - (BOOL)shouldRunOnMainThread { return YES; } | |
| - (void)showAlert { | |
| UIAlertView *alertView = [UIAlertView alloc]; | |
| alertView = [alertView initWithTitle:nil message:nil delegate:nil cancelButtonTitle:nil otherButtonTitles:nil]; | |
| [alertView show]; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { | |
| [Socialize storeUIErrorAlertsDisabled:YES]; | |
| [[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(errorNotification:) name:SocializeUIControllerDidFailWithErrorNotification object:nil]; | |
| return YES; | |
| } | |
| - (void)errorNotification:(NSNotification*)notification { | |
| NSError *error = [[notification userInfo] objectForKey:SocializeUIControllerErrorUserInfoKey]; | |
| NSLog(@"Error: %@", [error localizedDescription]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #import <Socialize/Socialize.h> | |
| - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions | |
| { | |
| //set the FB App Id, you can find your FB app Id here: https://developers.facebook.com/apps | |
| [Socialize storeFacebookAppId:@"YOUR FB APP ID"]; | |
| //your extra code goes here | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // | |
| // SampleEntityLoader.h | |
| // SocializeSDK | |
| // | |
| // Created by Nathaniel Griswold on 1/11/12. | |
| // Copyright (c) 2012 Socialize, Inc. All rights reserved. | |
| // | |
| #import <UIKit/UIKit.h> | |
| #import <Socialize/Socialize.h> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)someMethod { | |
| id<SocializeEntity> newEntity = [SocializeEntity entityWithKey:@"newEntity" name:@"New Entity"]; | |
| likeButton.entity = newEntity; | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| [Socialize setEntityLoaderBlock:^(UINavigationController *navigationController, id<SocializeEntity>entity) { | |
| if ([[entity key] isEqualToString:@"key1"]) { | |
| Loader1 *loader1 = [[[Loader1 alloc] initWithEntity:entity] autorelease]; | |
| [navigationController pushViewController:loader1 animated:YES]; | |
| } else if ([[entity key] isEqualToString:@"key2"]) { | |
| Loader2 *loader2 = [[[Loader1 alloc] initWithEntity:entity] autorelease]; | |
| [navigationController pushViewController:loader2 animated:YES]; | |
| } | |
| }]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env python | |
| import struct | |
| from binascii import a2b_hex, b2a_hex | |
| import socket | |
| import ssl | |
| import time | |
| import sys | |
| fmt = '!IH32s' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| - (void)showProfile { | |
| SZNavigationController *nav = [SocializeProfileViewController profileViewControllerInNavigationController]; | |
| [self presentModalViewController:nav animated:YES]; | |
| } |