- upgrade libidn
No files matched your search
@@ -1,41 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <asl.h>
|
||||
|
||||
#import "DDLog.h"
|
||||
|
||||
/**
|
||||
* Welcome to Cocoa Lumberjack!
|
||||
*
|
||||
* The project page has a wealth of documentation if you have any questions.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
||||
*
|
||||
*
|
||||
* This class provides a logger for the Apple System Log facility.
|
||||
*
|
||||
* As described in the "Getting Started" page,
|
||||
* the traditional NSLog() function directs it's output to two places:
|
||||
*
|
||||
* - Apple System Log
|
||||
* - StdErr (if stderr is a TTY) so log statements show up in Xcode console
|
||||
*
|
||||
* To duplicate NSLog() functionality you can simply add this logger and a tty logger.
|
||||
* However, if you instead choose to use file logging (for faster performance),
|
||||
* you may choose to use a file logger and a tty logger.
|
||||
**/
|
||||
|
||||
@interface DDASLLogger : DDAbstractLogger <DDLogger>
|
||||
{
|
||||
aslclient client;
|
||||
}
|
||||
|
||||
+ (instancetype)sharedInstance;
|
||||
|
||||
// Inherited from DDAbstractLogger
|
||||
|
||||
// - (id <DDLogFormatter>)logFormatter;
|
||||
// - (void)setLogFormatter:(id <DDLogFormatter>)formatter;
|
||||
|
||||
@end
|
||||
@@ -1,100 +0,0 @@
|
||||
#import "DDASLLogger.h"
|
||||
|
||||
#import <libkern/OSAtomic.h>
|
||||
|
||||
/**
|
||||
* Welcome to Cocoa Lumberjack!
|
||||
*
|
||||
* The project page has a wealth of documentation if you have any questions.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
||||
**/
|
||||
|
||||
#if ! __has_feature(objc_arc)
|
||||
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
||||
#endif
|
||||
|
||||
|
||||
@implementation DDASLLogger
|
||||
|
||||
static DDASLLogger *sharedInstance;
|
||||
|
||||
/**
|
||||
* The runtime sends initialize to each class in a program exactly one time just before the class,
|
||||
* or any class that inherits from it, is sent its first message from within the program. (Thus the
|
||||
* method may never be invoked if the class is not used.) The runtime sends the initialize message to
|
||||
* classes in a thread-safe manner. Superclasses receive this message before their subclasses.
|
||||
*
|
||||
* This method may also be called directly (assumably by accident), hence the safety mechanism.
|
||||
**/
|
||||
+ (void)initialize
|
||||
{
|
||||
static BOOL initialized = NO;
|
||||
if (!initialized)
|
||||
{
|
||||
initialized = YES;
|
||||
|
||||
sharedInstance = [[[self class] alloc] init];
|
||||
}
|
||||
}
|
||||
|
||||
+ (instancetype)sharedInstance
|
||||
{
|
||||
return sharedInstance;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if (sharedInstance != nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
if ((self = [super init]))
|
||||
{
|
||||
// A default asl client is provided for the main thread,
|
||||
// but background threads need to create their own client.
|
||||
|
||||
client = asl_open(NULL, "com.apple.console", 0);
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)logMessage:(DDLogMessage *)logMessage
|
||||
{
|
||||
NSString *logMsg = logMessage->logMsg;
|
||||
|
||||
if (formatter)
|
||||
{
|
||||
logMsg = [formatter formatLogMessage:logMessage];
|
||||
}
|
||||
|
||||
if (logMsg)
|
||||
{
|
||||
const char *msg = [logMsg UTF8String];
|
||||
|
||||
int aslLogLevel;
|
||||
switch (logMessage->logFlag)
|
||||
{
|
||||
// Note: By default ASL will filter anything above level 5 (Notice).
|
||||
// So our mappings shouldn't go above that level.
|
||||
|
||||
case LOG_FLAG_ERROR : aslLogLevel = ASL_LEVEL_ALERT; break;
|
||||
case LOG_FLAG_WARN : aslLogLevel = ASL_LEVEL_CRIT; break;
|
||||
case LOG_FLAG_INFO : aslLogLevel = ASL_LEVEL_ERR; break;
|
||||
case LOG_FLAG_DEBUG : aslLogLevel = ASL_LEVEL_WARNING; break;
|
||||
default : aslLogLevel = ASL_LEVEL_NOTICE; break;
|
||||
}
|
||||
|
||||
asl_log(client, NULL, aslLogLevel, "%s", msg);
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)loggerName
|
||||
{
|
||||
return @"cocoa.lumberjack.aslLogger";
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,102 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#import "DDLog.h"
|
||||
|
||||
/**
|
||||
* Welcome to Cocoa Lumberjack!
|
||||
*
|
||||
* The project page has a wealth of documentation if you have any questions.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
||||
*
|
||||
*
|
||||
* This class provides an abstract implementation of a database logger.
|
||||
*
|
||||
* That is, it provides the base implementation for a database logger to build atop of.
|
||||
* All that is needed for a concrete database logger is to extend this class
|
||||
* and override the methods in the implementation file that are prefixed with "db_".
|
||||
**/
|
||||
|
||||
@interface DDAbstractDatabaseLogger : DDAbstractLogger {
|
||||
@protected
|
||||
NSUInteger saveThreshold;
|
||||
NSTimeInterval saveInterval;
|
||||
NSTimeInterval maxAge;
|
||||
NSTimeInterval deleteInterval;
|
||||
BOOL deleteOnEverySave;
|
||||
|
||||
BOOL saveTimerSuspended;
|
||||
NSUInteger unsavedCount;
|
||||
dispatch_time_t unsavedTime;
|
||||
dispatch_source_t saveTimer;
|
||||
dispatch_time_t lastDeleteTime;
|
||||
dispatch_source_t deleteTimer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Specifies how often to save the data to disk.
|
||||
* Since saving is an expensive operation (disk io) it is not done after every log statement.
|
||||
* These properties allow you to configure how/when the logger saves to disk.
|
||||
*
|
||||
* A save is done when either (whichever happens first):
|
||||
*
|
||||
* - The number of unsaved log entries reaches saveThreshold
|
||||
* - The amount of time since the oldest unsaved log entry was created reaches saveInterval
|
||||
*
|
||||
* You can optionally disable the saveThreshold by setting it to zero.
|
||||
* If you disable the saveThreshold you are entirely dependent on the saveInterval.
|
||||
*
|
||||
* You can optionally disable the saveInterval by setting it to zero (or a negative value).
|
||||
* If you disable the saveInterval you are entirely dependent on the saveThreshold.
|
||||
*
|
||||
* It's not wise to disable both saveThreshold and saveInterval.
|
||||
*
|
||||
* The default saveThreshold is 500.
|
||||
* The default saveInterval is 60 seconds.
|
||||
**/
|
||||
@property (assign, readwrite) NSUInteger saveThreshold;
|
||||
@property (assign, readwrite) NSTimeInterval saveInterval;
|
||||
|
||||
/**
|
||||
* It is likely you don't want the log entries to persist forever.
|
||||
* Doing so would allow the database to grow infinitely large over time.
|
||||
*
|
||||
* The maxAge property provides a way to specify how old a log statement can get
|
||||
* before it should get deleted from the database.
|
||||
*
|
||||
* The deleteInterval specifies how often to sweep for old log entries.
|
||||
* Since deleting is an expensive operation (disk io) is is done on a fixed interval.
|
||||
*
|
||||
* An alternative to the deleteInterval is the deleteOnEverySave option.
|
||||
* This specifies that old log entries should be deleted during every save operation.
|
||||
*
|
||||
* You can optionally disable the maxAge by setting it to zero (or a negative value).
|
||||
* If you disable the maxAge then old log statements are not deleted.
|
||||
*
|
||||
* You can optionally disable the deleteInterval by setting it to zero (or a negative value).
|
||||
*
|
||||
* If you disable both deleteInterval and deleteOnEverySave then old log statements are not deleted.
|
||||
*
|
||||
* It's not wise to enable both deleteInterval and deleteOnEverySave.
|
||||
*
|
||||
* The default maxAge is 7 days.
|
||||
* The default deleteInterval is 5 minutes.
|
||||
* The default deleteOnEverySave is NO.
|
||||
**/
|
||||
@property (assign, readwrite) NSTimeInterval maxAge;
|
||||
@property (assign, readwrite) NSTimeInterval deleteInterval;
|
||||
@property (assign, readwrite) BOOL deleteOnEverySave;
|
||||
|
||||
/**
|
||||
* Forces a save of any pending log entries (flushes log entries to disk).
|
||||
**/
|
||||
- (void)savePendingLogEntries;
|
||||
|
||||
/**
|
||||
* Removes any log entries that are older than maxAge.
|
||||
**/
|
||||
- (void)deleteOldLogEntries;
|
||||
|
||||
@end
|
||||
@@ -1,727 +0,0 @@
|
||||
#import "DDAbstractDatabaseLogger.h"
|
||||
#import <math.h>
|
||||
|
||||
/**
|
||||
* Welcome to Cocoa Lumberjack!
|
||||
*
|
||||
* The project page has a wealth of documentation if you have any questions.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
||||
**/
|
||||
|
||||
#if ! __has_feature(objc_arc)
|
||||
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
||||
#endif
|
||||
|
||||
@interface DDAbstractDatabaseLogger ()
|
||||
- (void)destroySaveTimer;
|
||||
- (void)destroyDeleteTimer;
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@implementation DDAbstractDatabaseLogger
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
saveThreshold = 500;
|
||||
saveInterval = 60; // 60 seconds
|
||||
maxAge = (60 * 60 * 24 * 7); // 7 days
|
||||
deleteInterval = (60 * 5); // 5 minutes
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)dealloc
|
||||
{
|
||||
[self destroySaveTimer];
|
||||
[self destroyDeleteTimer];
|
||||
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark Override Me
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
- (BOOL)db_log:(DDLogMessage *)logMessage
|
||||
{
|
||||
// Override me and add your implementation.
|
||||
//
|
||||
// Return YES if an item was added to the buffer.
|
||||
// Return NO if the logMessage was ignored.
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)db_save
|
||||
{
|
||||
// Override me and add your implementation.
|
||||
}
|
||||
|
||||
- (void)db_delete
|
||||
{
|
||||
// Override me and add your implementation.
|
||||
}
|
||||
|
||||
- (void)db_saveAndDelete
|
||||
{
|
||||
// Override me and add your implementation.
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark Private API
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
- (void)performSaveAndSuspendSaveTimer
|
||||
{
|
||||
if (unsavedCount > 0)
|
||||
{
|
||||
if (deleteOnEverySave)
|
||||
[self db_saveAndDelete];
|
||||
else
|
||||
[self db_save];
|
||||
}
|
||||
|
||||
unsavedCount = 0;
|
||||
unsavedTime = 0;
|
||||
|
||||
if (saveTimer && !saveTimerSuspended)
|
||||
{
|
||||
dispatch_suspend(saveTimer);
|
||||
saveTimerSuspended = YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)performDelete
|
||||
{
|
||||
if (maxAge > 0.0)
|
||||
{
|
||||
[self db_delete];
|
||||
|
||||
lastDeleteTime = dispatch_time(DISPATCH_TIME_NOW, 0);
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark Timers
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
- (void)destroySaveTimer
|
||||
{
|
||||
if (saveTimer)
|
||||
{
|
||||
dispatch_source_cancel(saveTimer);
|
||||
if (saveTimerSuspended)
|
||||
{
|
||||
// Must resume a timer before releasing it (or it will crash)
|
||||
dispatch_resume(saveTimer);
|
||||
saveTimerSuspended = NO;
|
||||
}
|
||||
#if !OS_OBJECT_USE_OBJC
|
||||
dispatch_release(saveTimer);
|
||||
#endif
|
||||
saveTimer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateAndResumeSaveTimer
|
||||
{
|
||||
if ((saveTimer != NULL) && (saveInterval > 0.0) && (unsavedTime > 0.0))
|
||||
{
|
||||
uint64_t interval = (uint64_t)(saveInterval * NSEC_PER_SEC);
|
||||
dispatch_time_t startTime = dispatch_time(unsavedTime, interval);
|
||||
|
||||
dispatch_source_set_timer(saveTimer, startTime, interval, 1.0);
|
||||
|
||||
if (saveTimerSuspended)
|
||||
{
|
||||
dispatch_resume(saveTimer);
|
||||
saveTimerSuspended = NO;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)createSuspendedSaveTimer
|
||||
{
|
||||
if ((saveTimer == NULL) && (saveInterval > 0.0))
|
||||
{
|
||||
saveTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, loggerQueue);
|
||||
|
||||
dispatch_source_set_event_handler(saveTimer, ^{ @autoreleasepool {
|
||||
|
||||
[self performSaveAndSuspendSaveTimer];
|
||||
|
||||
}});
|
||||
|
||||
saveTimerSuspended = YES;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)destroyDeleteTimer
|
||||
{
|
||||
if (deleteTimer)
|
||||
{
|
||||
dispatch_source_cancel(deleteTimer);
|
||||
#if !OS_OBJECT_USE_OBJC
|
||||
dispatch_release(deleteTimer);
|
||||
#endif
|
||||
deleteTimer = NULL;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)updateDeleteTimer
|
||||
{
|
||||
if ((deleteTimer != NULL) && (deleteInterval > 0.0) && (maxAge > 0.0))
|
||||
{
|
||||
uint64_t interval = (uint64_t)(deleteInterval * NSEC_PER_SEC);
|
||||
dispatch_time_t startTime;
|
||||
|
||||
if (lastDeleteTime > 0)
|
||||
startTime = dispatch_time(lastDeleteTime, interval);
|
||||
else
|
||||
startTime = dispatch_time(DISPATCH_TIME_NOW, interval);
|
||||
|
||||
dispatch_source_set_timer(deleteTimer, startTime, interval, 1.0);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)createAndStartDeleteTimer
|
||||
{
|
||||
if ((deleteTimer == NULL) && (deleteInterval > 0.0) && (maxAge > 0.0))
|
||||
{
|
||||
deleteTimer = dispatch_source_create(DISPATCH_SOURCE_TYPE_TIMER, 0, 0, loggerQueue);
|
||||
|
||||
if (deleteTimer != NULL) {
|
||||
dispatch_source_set_event_handler(deleteTimer, ^{ @autoreleasepool {
|
||||
|
||||
[self performDelete];
|
||||
|
||||
}});
|
||||
|
||||
[self updateDeleteTimer];
|
||||
|
||||
if (deleteTimer != NULL) dispatch_resume(deleteTimer);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark Configuration
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
- (NSUInteger)saveThreshold
|
||||
{
|
||||
// The design of this method is taken from the DDAbstractLogger implementation.
|
||||
// For extensive documentation please refer to the DDAbstractLogger implementation.
|
||||
|
||||
// Note: The internal implementation MUST access the colorsEnabled variable directly,
|
||||
// This method is designed explicitly for external access.
|
||||
//
|
||||
// Using "self." syntax to go through this method will cause immediate deadlock.
|
||||
// This is the intended result. Fix it by accessing the ivar directly.
|
||||
// Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
|
||||
|
||||
NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
|
||||
NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
|
||||
|
||||
dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
|
||||
|
||||
__block NSUInteger result;
|
||||
|
||||
dispatch_sync(globalLoggingQueue, ^{
|
||||
dispatch_sync(loggerQueue, ^{
|
||||
result = saveThreshold;
|
||||
});
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)setSaveThreshold:(NSUInteger)threshold
|
||||
{
|
||||
dispatch_block_t block = ^{ @autoreleasepool {
|
||||
|
||||
if (saveThreshold != threshold)
|
||||
{
|
||||
saveThreshold = threshold;
|
||||
|
||||
// Since the saveThreshold has changed,
|
||||
// we check to see if the current unsavedCount has surpassed the new threshold.
|
||||
//
|
||||
// If it has, we immediately save the log.
|
||||
|
||||
if ((unsavedCount >= saveThreshold) && (saveThreshold > 0))
|
||||
{
|
||||
[self performSaveAndSuspendSaveTimer];
|
||||
}
|
||||
}
|
||||
}};
|
||||
|
||||
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
|
||||
// For documentation please refer to the DDAbstractLogger implementation.
|
||||
|
||||
if ([self isOnInternalLoggerQueue])
|
||||
{
|
||||
block();
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
|
||||
NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
|
||||
|
||||
dispatch_async(globalLoggingQueue, ^{
|
||||
dispatch_async(loggerQueue, block);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (NSTimeInterval)saveInterval
|
||||
{
|
||||
// The design of this method is taken from the DDAbstractLogger implementation.
|
||||
// For extensive documentation please refer to the DDAbstractLogger implementation.
|
||||
|
||||
// Note: The internal implementation MUST access the colorsEnabled variable directly,
|
||||
// This method is designed explicitly for external access.
|
||||
//
|
||||
// Using "self." syntax to go through this method will cause immediate deadlock.
|
||||
// This is the intended result. Fix it by accessing the ivar directly.
|
||||
// Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
|
||||
|
||||
NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
|
||||
NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
|
||||
|
||||
dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
|
||||
|
||||
__block NSTimeInterval result;
|
||||
|
||||
dispatch_sync(globalLoggingQueue, ^{
|
||||
dispatch_sync(loggerQueue, ^{
|
||||
result = saveInterval;
|
||||
});
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)setSaveInterval:(NSTimeInterval)interval
|
||||
{
|
||||
dispatch_block_t block = ^{ @autoreleasepool {
|
||||
|
||||
// C99 recommended floating point comparison macro
|
||||
// Read: isLessThanOrGreaterThan(floatA, floatB)
|
||||
|
||||
if (/* saveInterval != interval */ islessgreater(saveInterval, interval))
|
||||
{
|
||||
saveInterval = interval;
|
||||
|
||||
// There are several cases we need to handle here.
|
||||
//
|
||||
// 1. If the saveInterval was previously enabled and it just got disabled,
|
||||
// then we need to stop the saveTimer. (And we might as well release it.)
|
||||
//
|
||||
// 2. If the saveInterval was previously disabled and it just got enabled,
|
||||
// then we need to setup the saveTimer. (Plus we might need to do an immediate save.)
|
||||
//
|
||||
// 3. If the saveInterval increased, then we need to reset the timer so that it fires at the later date.
|
||||
//
|
||||
// 4. If the saveInterval decreased, then we need to reset the timer so that it fires at an earlier date.
|
||||
// (Plus we might need to do an immediate save.)
|
||||
|
||||
if (saveInterval > 0.0)
|
||||
{
|
||||
if (saveTimer == NULL)
|
||||
{
|
||||
// Handles #2
|
||||
//
|
||||
// Since the saveTimer uses the unsavedTime to calculate it's first fireDate,
|
||||
// if a save is needed the timer will fire immediately.
|
||||
|
||||
[self createSuspendedSaveTimer];
|
||||
[self updateAndResumeSaveTimer];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Handles #3
|
||||
// Handles #4
|
||||
//
|
||||
// Since the saveTimer uses the unsavedTime to calculate it's first fireDate,
|
||||
// if a save is needed the timer will fire immediately.
|
||||
|
||||
[self updateAndResumeSaveTimer];
|
||||
}
|
||||
}
|
||||
else if (saveTimer)
|
||||
{
|
||||
// Handles #1
|
||||
|
||||
[self destroySaveTimer];
|
||||
}
|
||||
}
|
||||
}};
|
||||
|
||||
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
|
||||
// For documentation please refer to the DDAbstractLogger implementation.
|
||||
|
||||
if ([self isOnInternalLoggerQueue])
|
||||
{
|
||||
block();
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
|
||||
NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
|
||||
|
||||
dispatch_async(globalLoggingQueue, ^{
|
||||
dispatch_async(loggerQueue, block);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (NSTimeInterval)maxAge
|
||||
{
|
||||
// The design of this method is taken from the DDAbstractLogger implementation.
|
||||
// For extensive documentation please refer to the DDAbstractLogger implementation.
|
||||
|
||||
// Note: The internal implementation MUST access the colorsEnabled variable directly,
|
||||
// This method is designed explicitly for external access.
|
||||
//
|
||||
// Using "self." syntax to go through this method will cause immediate deadlock.
|
||||
// This is the intended result. Fix it by accessing the ivar directly.
|
||||
// Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
|
||||
|
||||
NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
|
||||
NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
|
||||
|
||||
dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
|
||||
|
||||
__block NSTimeInterval result;
|
||||
|
||||
dispatch_sync(globalLoggingQueue, ^{
|
||||
dispatch_sync(loggerQueue, ^{
|
||||
result = maxAge;
|
||||
});
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)setMaxAge:(NSTimeInterval)interval
|
||||
{
|
||||
dispatch_block_t block = ^{ @autoreleasepool {
|
||||
|
||||
// C99 recommended floating point comparison macro
|
||||
// Read: isLessThanOrGreaterThan(floatA, floatB)
|
||||
|
||||
if (/* maxAge != interval */ islessgreater(maxAge, interval))
|
||||
{
|
||||
NSTimeInterval oldMaxAge = maxAge;
|
||||
NSTimeInterval newMaxAge = interval;
|
||||
|
||||
maxAge = interval;
|
||||
|
||||
// There are several cases we need to handle here.
|
||||
//
|
||||
// 1. If the maxAge was previously enabled and it just got disabled,
|
||||
// then we need to stop the deleteTimer. (And we might as well release it.)
|
||||
//
|
||||
// 2. If the maxAge was previously disabled and it just got enabled,
|
||||
// then we need to setup the deleteTimer. (Plus we might need to do an immediate delete.)
|
||||
//
|
||||
// 3. If the maxAge was increased,
|
||||
// then we don't need to do anything.
|
||||
//
|
||||
// 4. If the maxAge was decreased,
|
||||
// then we should do an immediate delete.
|
||||
|
||||
BOOL shouldDeleteNow = NO;
|
||||
|
||||
if (oldMaxAge > 0.0)
|
||||
{
|
||||
if (newMaxAge <= 0.0)
|
||||
{
|
||||
// Handles #1
|
||||
|
||||
[self destroyDeleteTimer];
|
||||
}
|
||||
else if (oldMaxAge > newMaxAge)
|
||||
{
|
||||
// Handles #4
|
||||
shouldDeleteNow = YES;
|
||||
}
|
||||
}
|
||||
else if (newMaxAge > 0.0)
|
||||
{
|
||||
// Handles #2
|
||||
shouldDeleteNow = YES;
|
||||
}
|
||||
|
||||
if (shouldDeleteNow)
|
||||
{
|
||||
[self performDelete];
|
||||
|
||||
if (deleteTimer)
|
||||
[self updateDeleteTimer];
|
||||
else
|
||||
[self createAndStartDeleteTimer];
|
||||
}
|
||||
}
|
||||
}};
|
||||
|
||||
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
|
||||
// For documentation please refer to the DDAbstractLogger implementation.
|
||||
|
||||
if ([self isOnInternalLoggerQueue])
|
||||
{
|
||||
block();
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
|
||||
NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
|
||||
|
||||
dispatch_async(globalLoggingQueue, ^{
|
||||
dispatch_async(loggerQueue, block);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (NSTimeInterval)deleteInterval
|
||||
{
|
||||
// The design of this method is taken from the DDAbstractLogger implementation.
|
||||
// For extensive documentation please refer to the DDAbstractLogger implementation.
|
||||
|
||||
// Note: The internal implementation MUST access the colorsEnabled variable directly,
|
||||
// This method is designed explicitly for external access.
|
||||
//
|
||||
// Using "self." syntax to go through this method will cause immediate deadlock.
|
||||
// This is the intended result. Fix it by accessing the ivar directly.
|
||||
// Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
|
||||
|
||||
NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
|
||||
NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
|
||||
|
||||
dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
|
||||
|
||||
__block NSTimeInterval result;
|
||||
|
||||
dispatch_sync(globalLoggingQueue, ^{
|
||||
dispatch_sync(loggerQueue, ^{
|
||||
result = deleteInterval;
|
||||
});
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)setDeleteInterval:(NSTimeInterval)interval
|
||||
{
|
||||
dispatch_block_t block = ^{ @autoreleasepool {
|
||||
|
||||
// C99 recommended floating point comparison macro
|
||||
// Read: isLessThanOrGreaterThan(floatA, floatB)
|
||||
|
||||
if (/* deleteInterval != interval */ islessgreater(deleteInterval, interval))
|
||||
{
|
||||
deleteInterval = interval;
|
||||
|
||||
// There are several cases we need to handle here.
|
||||
//
|
||||
// 1. If the deleteInterval was previously enabled and it just got disabled,
|
||||
// then we need to stop the deleteTimer. (And we might as well release it.)
|
||||
//
|
||||
// 2. If the deleteInterval was previously disabled and it just got enabled,
|
||||
// then we need to setup the deleteTimer. (Plus we might need to do an immediate delete.)
|
||||
//
|
||||
// 3. If the deleteInterval increased, then we need to reset the timer so that it fires at the later date.
|
||||
//
|
||||
// 4. If the deleteInterval decreased, then we need to reset the timer so that it fires at an earlier date.
|
||||
// (Plus we might need to do an immediate delete.)
|
||||
|
||||
if (deleteInterval > 0.0)
|
||||
{
|
||||
if (deleteTimer == NULL)
|
||||
{
|
||||
// Handles #2
|
||||
//
|
||||
// Since the deleteTimer uses the lastDeleteTime to calculate it's first fireDate,
|
||||
// if a delete is needed the timer will fire immediately.
|
||||
|
||||
[self createAndStartDeleteTimer];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Handles #3
|
||||
// Handles #4
|
||||
//
|
||||
// Since the deleteTimer uses the lastDeleteTime to calculate it's first fireDate,
|
||||
// if a save is needed the timer will fire immediately.
|
||||
|
||||
[self updateDeleteTimer];
|
||||
}
|
||||
}
|
||||
else if (deleteTimer)
|
||||
{
|
||||
// Handles #1
|
||||
|
||||
[self destroyDeleteTimer];
|
||||
}
|
||||
}
|
||||
}};
|
||||
|
||||
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
|
||||
// For documentation please refer to the DDAbstractLogger implementation.
|
||||
|
||||
if ([self isOnInternalLoggerQueue])
|
||||
{
|
||||
block();
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
|
||||
NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
|
||||
|
||||
dispatch_async(globalLoggingQueue, ^{
|
||||
dispatch_async(loggerQueue, block);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
- (BOOL)deleteOnEverySave
|
||||
{
|
||||
// The design of this method is taken from the DDAbstractLogger implementation.
|
||||
// For extensive documentation please refer to the DDAbstractLogger implementation.
|
||||
|
||||
// Note: The internal implementation MUST access the colorsEnabled variable directly,
|
||||
// This method is designed explicitly for external access.
|
||||
//
|
||||
// Using "self." syntax to go through this method will cause immediate deadlock.
|
||||
// This is the intended result. Fix it by accessing the ivar directly.
|
||||
// Great strides have been take to ensure this is safe to do. Plus it's MUCH faster.
|
||||
|
||||
NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
|
||||
NSAssert(![self isOnInternalLoggerQueue], @"MUST access ivar directly, NOT via self.* syntax.");
|
||||
|
||||
dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
|
||||
|
||||
__block BOOL result;
|
||||
|
||||
dispatch_sync(globalLoggingQueue, ^{
|
||||
dispatch_sync(loggerQueue, ^{
|
||||
result = deleteOnEverySave;
|
||||
});
|
||||
});
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)setDeleteOnEverySave:(BOOL)flag
|
||||
{
|
||||
dispatch_block_t block = ^{
|
||||
|
||||
deleteOnEverySave = flag;
|
||||
};
|
||||
|
||||
// The design of the setter logic below is taken from the DDAbstractLogger implementation.
|
||||
// For documentation please refer to the DDAbstractLogger implementation.
|
||||
|
||||
if ([self isOnInternalLoggerQueue])
|
||||
{
|
||||
block();
|
||||
}
|
||||
else
|
||||
{
|
||||
dispatch_queue_t globalLoggingQueue = [DDLog loggingQueue];
|
||||
NSAssert(![self isOnGlobalLoggingQueue], @"Core architecture requirement failure");
|
||||
|
||||
dispatch_async(globalLoggingQueue, ^{
|
||||
dispatch_async(loggerQueue, block);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark Public API
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
- (void)savePendingLogEntries
|
||||
{
|
||||
dispatch_block_t block = ^{ @autoreleasepool {
|
||||
|
||||
[self performSaveAndSuspendSaveTimer];
|
||||
}};
|
||||
|
||||
if ([self isOnInternalLoggerQueue])
|
||||
block();
|
||||
else
|
||||
dispatch_async(loggerQueue, block);
|
||||
}
|
||||
|
||||
- (void)deleteOldLogEntries
|
||||
{
|
||||
dispatch_block_t block = ^{ @autoreleasepool {
|
||||
|
||||
[self performDelete];
|
||||
}};
|
||||
|
||||
if ([self isOnInternalLoggerQueue])
|
||||
block();
|
||||
else
|
||||
dispatch_async(loggerQueue, block);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark DDLogger
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
- (void)didAddLogger
|
||||
{
|
||||
// If you override me be sure to invoke [super didAddLogger];
|
||||
|
||||
[self createSuspendedSaveTimer];
|
||||
|
||||
[self createAndStartDeleteTimer];
|
||||
}
|
||||
|
||||
- (void)willRemoveLogger
|
||||
{
|
||||
// If you override me be sure to invoke [super willRemoveLogger];
|
||||
|
||||
[self performSaveAndSuspendSaveTimer];
|
||||
|
||||
[self destroySaveTimer];
|
||||
[self destroyDeleteTimer];
|
||||
}
|
||||
|
||||
- (void)logMessage:(DDLogMessage *)logMessage
|
||||
{
|
||||
if ([self db_log:logMessage])
|
||||
{
|
||||
BOOL firstUnsavedEntry = (++unsavedCount == 1);
|
||||
|
||||
if ((unsavedCount >= saveThreshold) && (saveThreshold > 0))
|
||||
{
|
||||
[self performSaveAndSuspendSaveTimer];
|
||||
}
|
||||
else if (firstUnsavedEntry)
|
||||
{
|
||||
unsavedTime = dispatch_time(DISPATCH_TIME_NOW, 0);
|
||||
[self updateAndResumeSaveTimer];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
- (void)flush
|
||||
{
|
||||
// This method is invoked by DDLog's flushLog method.
|
||||
//
|
||||
// It is called automatically when the application quits,
|
||||
// or if the developer invokes DDLog's flushLog method prior to crashing or something.
|
||||
|
||||
[self performSaveAndSuspendSaveTimer];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,369 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "DDLog.h"
|
||||
|
||||
@class DDLogFileInfo;
|
||||
|
||||
/**
|
||||
* Welcome to Cocoa Lumberjack!
|
||||
*
|
||||
* The project page has a wealth of documentation if you have any questions.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
||||
*
|
||||
*
|
||||
* This class provides a logger to write log statements to a file.
|
||||
**/
|
||||
|
||||
|
||||
// Default configuration and safety/sanity values.
|
||||
//
|
||||
// maximumFileSize -> DEFAULT_LOG_MAX_FILE_SIZE
|
||||
// rollingFrequency -> DEFAULT_LOG_ROLLING_FREQUENCY
|
||||
// maximumNumberOfLogFiles -> DEFAULT_LOG_MAX_NUM_LOG_FILES
|
||||
//
|
||||
// You should carefully consider the proper configuration values for your application.
|
||||
|
||||
#define DEFAULT_LOG_MAX_FILE_SIZE (1024 * 1024) // 1 MB
|
||||
#define DEFAULT_LOG_ROLLING_FREQUENCY (60 * 60 * 24) // 24 Hours
|
||||
#define DEFAULT_LOG_MAX_NUM_LOG_FILES (5) // 5 Files
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
// The LogFileManager protocol is designed to allow you to control all aspects of your log files.
|
||||
//
|
||||
// The primary purpose of this is to allow you to do something with the log files after they have been rolled.
|
||||
// Perhaps you want to compress them to save disk space.
|
||||
// Perhaps you want to upload them to an FTP server.
|
||||
// Perhaps you want to run some analytics on the file.
|
||||
//
|
||||
// A default LogFileManager is, of course, provided.
|
||||
// The default LogFileManager simply deletes old log files according to the maximumNumberOfLogFiles property.
|
||||
//
|
||||
// This protocol provides various methods to fetch the list of log files.
|
||||
//
|
||||
// There are two variants: sorted and unsorted.
|
||||
// If sorting is not necessary, the unsorted variant is obviously faster.
|
||||
// The sorted variant will return an array sorted by when the log files were created,
|
||||
// with the most recently created log file at index 0, and the oldest log file at the end of the array.
|
||||
//
|
||||
// You can fetch only the log file paths (full path including name), log file names (name only),
|
||||
// or an array of DDLogFileInfo objects.
|
||||
// The DDLogFileInfo class is documented below, and provides a handy wrapper that
|
||||
// gives you easy access to various file attributes such as the creation date or the file size.
|
||||
|
||||
@protocol DDLogFileManager <NSObject>
|
||||
@required
|
||||
|
||||
// Public properties
|
||||
|
||||
/**
|
||||
* The maximum number of archived log files to keep on disk.
|
||||
* For example, if this property is set to 3,
|
||||
* then the LogFileManager will only keep 3 archived log files (plus the current active log file) on disk.
|
||||
* Once the active log file is rolled/archived, then the oldest of the existing 3 rolled/archived log files is deleted.
|
||||
*
|
||||
* You may optionally disable deleting old/rolled/archived log files by setting this property to zero.
|
||||
**/
|
||||
@property (readwrite, assign) NSUInteger maximumNumberOfLogFiles;
|
||||
|
||||
// Public methods
|
||||
|
||||
- (NSString *)logsDirectory;
|
||||
|
||||
- (NSArray *)unsortedLogFilePaths;
|
||||
- (NSArray *)unsortedLogFileNames;
|
||||
- (NSArray *)unsortedLogFileInfos;
|
||||
|
||||
- (NSArray *)sortedLogFilePaths;
|
||||
- (NSArray *)sortedLogFileNames;
|
||||
- (NSArray *)sortedLogFileInfos;
|
||||
|
||||
// Private methods (only to be used by DDFileLogger)
|
||||
|
||||
- (NSString *)createNewLogFile;
|
||||
|
||||
@optional
|
||||
|
||||
// Notifications from DDFileLogger
|
||||
|
||||
- (void)didArchiveLogFile:(NSString *)logFilePath;
|
||||
- (void)didRollAndArchiveLogFile:(NSString *)logFilePath;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Default log file manager.
|
||||
*
|
||||
* All log files are placed inside the logsDirectory.
|
||||
* If a specific logsDirectory isn't specified, the default directory is used.
|
||||
* On Mac, this is in ~/Library/Logs/<Application Name>.
|
||||
* On iPhone, this is in ~/Library/Caches/Logs.
|
||||
*
|
||||
* Log files are named "<bundle identifier> <date> <time>.log"
|
||||
* Example: com.organization.myapp 2013-12-03 17-14.log
|
||||
*
|
||||
* Archived log files are automatically deleted according to the maximumNumberOfLogFiles property.
|
||||
**/
|
||||
@interface DDLogFileManagerDefault : NSObject <DDLogFileManager>
|
||||
{
|
||||
NSUInteger maximumNumberOfLogFiles;
|
||||
NSString *_logsDirectory;
|
||||
}
|
||||
|
||||
- (id)init;
|
||||
- (instancetype)initWithLogsDirectory:(NSString *)logsDirectory;
|
||||
|
||||
/*
|
||||
* Methods to override.
|
||||
*
|
||||
* Log files are named "<bundle identifier> <date> <time>.log"
|
||||
* Example: com.organization.myapp 2013-12-03 17-14.log
|
||||
*
|
||||
* If you wish to change default filename, you can override following two methods.
|
||||
* - newLogFileName method would be called on new logfile creation.
|
||||
* - isLogFile: method would be called to filter logfiles from all other files in logsDirectory.
|
||||
* You have to parse given filename and return YES if it is logFile.
|
||||
*
|
||||
* **NOTE**
|
||||
* newLogFileName returns filename. If appropriate file already exists, number would be added
|
||||
* to filename before extension. You have to handle this case in isLogFile: method.
|
||||
*
|
||||
* Example:
|
||||
* - newLogFileName returns "com.organization.myapp 2013-12-03.log",
|
||||
* file "com.organization.myapp 2013-12-03.log" would be created.
|
||||
* - after some time "com.organization.myapp 2013-12-03.log" is archived
|
||||
* - newLogFileName again returns "com.organization.myapp 2013-12-03.log",
|
||||
* file "com.organization.myapp 2013-12-03 2.log" would be created.
|
||||
* - after some time "com.organization.myapp 2013-12-03 1.log" is archived
|
||||
* - newLogFileName again returns "com.organization.myapp 2013-12-03.log",
|
||||
* file "com.organization.myapp 2013-12-03 3.log" would be created.
|
||||
**/
|
||||
- (NSString *)newLogFileName;
|
||||
- (BOOL)isLogFile:(NSString *)fileName;
|
||||
|
||||
/* Inherited from DDLogFileManager protocol:
|
||||
|
||||
@property (readwrite, assign) NSUInteger maximumNumberOfLogFiles;
|
||||
|
||||
- (NSString *)logsDirectory;
|
||||
|
||||
- (NSArray *)unsortedLogFilePaths;
|
||||
- (NSArray *)unsortedLogFileNames;
|
||||
- (NSArray *)unsortedLogFileInfos;
|
||||
|
||||
- (NSArray *)sortedLogFilePaths;
|
||||
- (NSArray *)sortedLogFileNames;
|
||||
- (NSArray *)sortedLogFileInfos;
|
||||
|
||||
*/
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Most users will want file log messages to be prepended with the date and time.
|
||||
* Rather than forcing the majority of users to write their own formatter,
|
||||
* we will supply a logical default formatter.
|
||||
* Users can easily replace this formatter with their own by invoking the setLogFormatter method.
|
||||
* It can also be removed by calling setLogFormatter, and passing a nil parameter.
|
||||
*
|
||||
* In addition to the convenience of having a logical default formatter,
|
||||
* it will also provide a template that makes it easy for developers to copy and change.
|
||||
**/
|
||||
@interface DDLogFileFormatterDefault : NSObject <DDLogFormatter>
|
||||
{
|
||||
NSDateFormatter *dateFormatter;
|
||||
}
|
||||
|
||||
- (id)init;
|
||||
- (instancetype)initWithDateFormatter:(NSDateFormatter *)dateFormatter;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface DDFileLogger : DDAbstractLogger <DDLogger>
|
||||
{
|
||||
__strong id <DDLogFileManager> logFileManager;
|
||||
|
||||
DDLogFileInfo *currentLogFileInfo;
|
||||
NSFileHandle *currentLogFileHandle;
|
||||
|
||||
dispatch_source_t currentLogFileVnode;
|
||||
dispatch_source_t rollingTimer;
|
||||
|
||||
unsigned long long maximumFileSize;
|
||||
NSTimeInterval rollingFrequency;
|
||||
}
|
||||
|
||||
- (id)init;
|
||||
- (instancetype)initWithLogFileManager:(id <DDLogFileManager>)logFileManager;
|
||||
|
||||
/**
|
||||
* Log File Rolling:
|
||||
*
|
||||
* maximumFileSize:
|
||||
* The approximate maximum size to allow log files to grow.
|
||||
* If a log file is larger than this value after a log statement is appended,
|
||||
* then the log file is rolled.
|
||||
*
|
||||
* rollingFrequency
|
||||
* How often to roll the log file.
|
||||
* The frequency is given as an NSTimeInterval, which is a double that specifies the interval in seconds.
|
||||
* Once the log file gets to be this old, it is rolled.
|
||||
*
|
||||
* Both the maximumFileSize and the rollingFrequency are used to manage rolling.
|
||||
* Whichever occurs first will cause the log file to be rolled.
|
||||
*
|
||||
* For example:
|
||||
* The rollingFrequency is 24 hours,
|
||||
* but the log file surpasses the maximumFileSize after only 20 hours.
|
||||
* The log file will be rolled at that 20 hour mark.
|
||||
* A new log file will be created, and the 24 hour timer will be restarted.
|
||||
*
|
||||
* You may optionally disable rolling due to filesize by setting maximumFileSize to zero.
|
||||
* If you do so, rolling is based solely on rollingFrequency.
|
||||
*
|
||||
* You may optionally disable rolling due to time by setting rollingFrequency to zero (or any non-positive number).
|
||||
* If you do so, rolling is based solely on maximumFileSize.
|
||||
*
|
||||
* If you disable both maximumFileSize and rollingFrequency, then the log file won't ever be rolled.
|
||||
* This is strongly discouraged.
|
||||
**/
|
||||
@property (readwrite, assign) unsigned long long maximumFileSize;
|
||||
@property (readwrite, assign) NSTimeInterval rollingFrequency;
|
||||
|
||||
/**
|
||||
* The DDLogFileManager instance can be used to retrieve the list of log files,
|
||||
* and configure the maximum number of archived log files to keep.
|
||||
*
|
||||
* @see DDLogFileManager.maximumNumberOfLogFiles
|
||||
**/
|
||||
@property (strong, nonatomic, readonly) id <DDLogFileManager> logFileManager;
|
||||
|
||||
|
||||
// You can optionally force the current log file to be rolled with this method.
|
||||
// CompletionBlock will be called on main queue.
|
||||
|
||||
- (void)rollLogFileWithCompletionBlock:(void (^)())completionBlock;
|
||||
|
||||
// Method is deprecated. Use rollLogFileWithCompletionBlock: method instead.
|
||||
|
||||
- (void)rollLogFile __attribute((deprecated));
|
||||
|
||||
// Inherited from DDAbstractLogger
|
||||
|
||||
// - (id <DDLogFormatter>)logFormatter;
|
||||
// - (void)setLogFormatter:(id <DDLogFormatter>)formatter;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* DDLogFileInfo is a simple class that provides access to various file attributes.
|
||||
* It provides good performance as it only fetches the information if requested,
|
||||
* and it caches the information to prevent duplicate fetches.
|
||||
*
|
||||
* It was designed to provide quick snapshots of the current state of log files,
|
||||
* and to help sort log files in an array.
|
||||
*
|
||||
* This class does not monitor the files, or update it's cached attribute values if the file changes on disk.
|
||||
* This is not what the class was designed for.
|
||||
*
|
||||
* If you absolutely must get updated values,
|
||||
* you can invoke the reset method which will clear the cache.
|
||||
**/
|
||||
@interface DDLogFileInfo : NSObject
|
||||
{
|
||||
__strong NSString *filePath;
|
||||
__strong NSString *fileName;
|
||||
|
||||
__strong NSDictionary *fileAttributes;
|
||||
|
||||
__strong NSDate *creationDate;
|
||||
__strong NSDate *modificationDate;
|
||||
|
||||
unsigned long long fileSize;
|
||||
}
|
||||
|
||||
@property (strong, nonatomic, readonly) NSString *filePath;
|
||||
@property (strong, nonatomic, readonly) NSString *fileName;
|
||||
|
||||
@property (strong, nonatomic, readonly) NSDictionary *fileAttributes;
|
||||
|
||||
@property (strong, nonatomic, readonly) NSDate *creationDate;
|
||||
@property (strong, nonatomic, readonly) NSDate *modificationDate;
|
||||
|
||||
@property (nonatomic, readonly) unsigned long long fileSize;
|
||||
|
||||
@property (nonatomic, readonly) NSTimeInterval age;
|
||||
|
||||
@property (nonatomic, readwrite) BOOL isArchived;
|
||||
|
||||
+ (instancetype)logFileWithPath:(NSString *)filePath;
|
||||
|
||||
- (instancetype)initWithFilePath:(NSString *)filePath;
|
||||
|
||||
- (void)reset;
|
||||
- (void)renameFile:(NSString *)newFileName;
|
||||
|
||||
#if TARGET_IPHONE_SIMULATOR
|
||||
|
||||
// So here's the situation.
|
||||
// Extended attributes are perfect for what we're trying to do here (marking files as archived).
|
||||
// This is exactly what extended attributes were designed for.
|
||||
//
|
||||
// But Apple screws us over on the simulator.
|
||||
// Everytime you build-and-go, they copy the application into a new folder on the hard drive,
|
||||
// and as part of the process they strip extended attributes from our log files.
|
||||
// Normally, a copy of a file preserves extended attributes.
|
||||
// So obviously Apple has gone to great lengths to piss us off.
|
||||
//
|
||||
// Thus we use a slightly different tactic for marking log files as archived in the simulator.
|
||||
// That way it "just works" and there's no confusion when testing.
|
||||
//
|
||||
// The difference in method names is indicative of the difference in functionality.
|
||||
// On the simulator we add an attribute by appending a filename extension.
|
||||
//
|
||||
// For example:
|
||||
// "mylog.txt" -> "mylog.archived.txt"
|
||||
// "mylog" -> "mylog.archived"
|
||||
|
||||
- (BOOL)hasExtensionAttributeWithName:(NSString *)attrName;
|
||||
|
||||
- (void)addExtensionAttributeWithName:(NSString *)attrName;
|
||||
- (void)removeExtensionAttributeWithName:(NSString *)attrName;
|
||||
|
||||
#else
|
||||
|
||||
// Normal use of extended attributes used everywhere else,
|
||||
// such as on Macs and on iPhone devices.
|
||||
|
||||
- (BOOL)hasExtendedAttributeWithName:(NSString *)attrName;
|
||||
|
||||
- (void)addExtendedAttributeWithName:(NSString *)attrName;
|
||||
- (void)removeExtendedAttributeWithName:(NSString *)attrName;
|
||||
|
||||
#endif
|
||||
|
||||
- (NSComparisonResult)reverseCompareByCreationDate:(DDLogFileInfo *)another;
|
||||
- (NSComparisonResult)reverseCompareByModificationDate:(DDLogFileInfo *)another;
|
||||
|
||||
@end
|
||||
@@ -1,99 +0,0 @@
|
||||
//
|
||||
// DDLog+LOGV.h
|
||||
// Lumberjack
|
||||
//
|
||||
// Created by Mike Pontillo on 11/20/12.
|
||||
//
|
||||
//
|
||||
|
||||
#ifndef Lumberjack_DDLog_LOGV_h
|
||||
#define Lumberjack_DDLog_LOGV_h
|
||||
|
||||
#import "DDLog.h"
|
||||
|
||||
|
||||
#define LOGV_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, avalist) \
|
||||
[DDLog log:isAsynchronous \
|
||||
level:lvl \
|
||||
flag:flg \
|
||||
context:ctx \
|
||||
file:__FILE__ \
|
||||
function:fnct \
|
||||
line:__LINE__ \
|
||||
tag:atag \
|
||||
format:frmt \
|
||||
args:avalist]
|
||||
|
||||
#define LOGV_OBJC_MACRO(async, lvl, flg, ctx, frmt, avalist) \
|
||||
LOGV_MACRO(async, lvl, flg, ctx, nil, sel_getName(_cmd), frmt, avalist)
|
||||
|
||||
#define LOGV_C_MACRO(async, lvl, flg, ctx, frmt, avalist) \
|
||||
LOGV_MACRO(async, lvl, flg, ctx, nil, __FUNCTION__, frmt, avalist)
|
||||
|
||||
|
||||
|
||||
#define SYNC_LOGV_OBJC_MACRO(lvl, flg, ctx, frmt, avalist) \
|
||||
LOGV_OBJC_MACRO( NO, lvl, flg, ctx, frmt, avalist)
|
||||
|
||||
#define ASYNC_LOGV_OBJC_MACRO(lvl, flg, ctx, frmt, avalist) \
|
||||
LOGV_OBJC_MACRO(YES, lvl, flg, ctx, frmt, avalist)
|
||||
|
||||
#define SYNC_LOGV_C_MACRO(lvl, flg, ctx, frmt, avalist) \
|
||||
LOGV_C_MACRO( NO, lvl, flg, ctx, frmt, avalist)
|
||||
|
||||
#define ASYNC_LOGV_C_MACRO(lvl, flg, ctx, frmt, avalist) \
|
||||
LOGV_C_MACRO(YES, lvl, flg, ctx, frmt, avalist)
|
||||
|
||||
|
||||
|
||||
#define LOGV_MAYBE(async, lvl, flg, ctx, fnct, frmt, avalist) \
|
||||
do { if(lvl & flg) LOGV_MACRO(async, lvl, flg, ctx, nil, fnct, frmt, avalist); } while(0)
|
||||
|
||||
#define LOGV_OBJC_MAYBE(async, lvl, flg, ctx, frmt, avalist) \
|
||||
LOGV_MAYBE(async, lvl, flg, ctx, sel_getName(_cmd), frmt, avalist)
|
||||
|
||||
#define LOGV_C_MAYBE(async, lvl, flg, ctx, frmt, avalist) \
|
||||
LOGV_MAYBE(async, lvl, flg, ctx, __FUNCTION__, frmt, avalist)
|
||||
|
||||
#define SYNC_LOGV_OBJC_MAYBE(lvl, flg, ctx, frmt, avalist) \
|
||||
LOGV_OBJC_MAYBE( NO, lvl, flg, ctx, frmt, avalist)
|
||||
|
||||
#define ASYNC_LOGV_OBJC_MAYBE(lvl, flg, ctx, frmt, avalist) \
|
||||
LOGV_OBJC_MAYBE(YES, lvl, flg, ctx, frmt, avalist)
|
||||
|
||||
#define SYNC_LOGV_C_MAYBE(lvl, flg, ctx, frmt, avalist) \
|
||||
LOGV_C_MAYBE( NO, lvl, flg, ctx, frmt, avalist)
|
||||
|
||||
#define ASYNC_LOGV_C_MAYBE(lvl, flg, ctx, frmt, avalist) \
|
||||
LOGV_C_MAYBE(YES, lvl, flg, ctx, frmt, avalist)
|
||||
|
||||
|
||||
|
||||
#define LOGV_OBJC_TAG_MACRO(async, lvl, flg, ctx, tag, frmt, avalist) \
|
||||
LOGV_MACRO(async, lvl, flg, ctx, tag, sel_getName(_cmd), frmt, avalist)
|
||||
|
||||
#define LOGV_C_TAG_MACRO(async, lvl, flg, ctx, tag, frmt, avalist) \
|
||||
LOGV_MACRO(async, lvl, flg, ctx, tag, __FUNCTION__, frmt, avalist)
|
||||
|
||||
#define LOGV_TAG_MAYBE(async, lvl, flg, ctx, tag, fnct, frmt, avalist) \
|
||||
do { if(lvl & flg) LOGV_MACRO(async, lvl, flg, ctx, tag, fnct, frmt, avalist); } while(0)
|
||||
|
||||
#define LOGV_OBJC_TAG_MAYBE(async, lvl, flg, ctx, tag, frmt, avalist) \
|
||||
LOGV_TAG_MAYBE(async, lvl, flg, ctx, tag, sel_getName(_cmd), frmt, avalist)
|
||||
|
||||
#define LOGV_C_TAG_MAYBE(async, lvl, flg, ctx, tag, frmt, avalist) \
|
||||
LOGV_TAG_MAYBE(async, lvl, flg, ctx, tag, __FUNCTION__, frmt, avalist)
|
||||
|
||||
|
||||
|
||||
#define DDLogvError(frmt, avalist) LOGV_OBJC_MAYBE(LOG_ASYNC_ERROR, ddLogLevel, LOG_FLAG_ERROR, 0, frmt, avalist)
|
||||
#define DDLogvWarn(frmt, avalist) LOGV_OBJC_MAYBE(LOG_ASYNC_WARN, ddLogLevel, LOG_FLAG_WARN, 0, frmt, avalist)
|
||||
#define DDLogvInfo(frmt, avalist) LOGV_OBJC_MAYBE(LOG_ASYNC_INFO, ddLogLevel, LOG_FLAG_INFO, 0, frmt, avalist)
|
||||
#define DDLogvVerbose(frmt, avalist) LOGV_OBJC_MAYBE(LOG_ASYNC_VERBOSE, ddLogLevel, LOG_FLAG_VERBOSE, 0, frmt, avalist)
|
||||
|
||||
#define DDLogvCError(frmt, avalist) LOGV_C_MAYBE(LOG_ASYNC_ERROR, ddLogLevel, LOG_FLAG_ERROR, 0, frmt, avalist)
|
||||
#define DDLogvCWarn(frmt, avalist) LOGV_C_MAYBE(LOG_ASYNC_WARN, ddLogLevel, LOG_FLAG_WARN, 0, frmt, avalist)
|
||||
#define DDLogvCInfo(frmt, avalist) LOGV_C_MAYBE(LOG_ASYNC_INFO, ddLogLevel, LOG_FLAG_INFO, 0, frmt, avalist)
|
||||
#define DDLogvCVerbose(frmt, avalist) LOGV_C_MAYBE(LOG_ASYNC_VERBOSE, ddLogLevel, LOG_FLAG_VERBOSE, 0, frmt, avalist)
|
||||
|
||||
#endif
|
||||
@@ -1,634 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
/**
|
||||
* Welcome to Cocoa Lumberjack!
|
||||
*
|
||||
* The project page has a wealth of documentation if you have any questions.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
||||
*
|
||||
* Otherwise, here is a quick refresher.
|
||||
* There are three steps to using the macros:
|
||||
*
|
||||
* Step 1:
|
||||
* Import the header in your implementation file:
|
||||
*
|
||||
* #import "DDLog.h"
|
||||
*
|
||||
* Step 2:
|
||||
* Define your logging level in your implementation file:
|
||||
*
|
||||
* // Log levels: off, error, warn, info, verbose
|
||||
* static const int ddLogLevel = LOG_LEVEL_VERBOSE;
|
||||
*
|
||||
* Step 2 [3rd party frameworks]:
|
||||
*
|
||||
* Define your LOG_LEVEL_DEF to a different variable/function than ddLogLevel:
|
||||
*
|
||||
* // #undef LOG_LEVEL_DEF // Undefine first only if needed
|
||||
* #define LOG_LEVEL_DEF myLibLogLevel
|
||||
*
|
||||
* Define your logging level in your implementation file:
|
||||
*
|
||||
* // Log levels: off, error, warn, info, verbose
|
||||
* static const int myLibLogLevel = LOG_LEVEL_VERBOSE;
|
||||
*
|
||||
* Step 3:
|
||||
* Replace your NSLog statements with DDLog statements according to the severity of the message.
|
||||
*
|
||||
* NSLog(@"Fatal error, no dohickey found!"); -> DDLogError(@"Fatal error, no dohickey found!");
|
||||
*
|
||||
* DDLog works exactly the same as NSLog.
|
||||
* This means you can pass it multiple variables just like NSLog.
|
||||
**/
|
||||
|
||||
#ifndef LOG_LEVEL_DEF
|
||||
#define LOG_LEVEL_DEF ddLogLevel
|
||||
#endif
|
||||
|
||||
@class DDLogMessage;
|
||||
|
||||
@protocol DDLogger;
|
||||
@protocol DDLogFormatter;
|
||||
|
||||
/**
|
||||
* This is the single macro that all other macros below compile into.
|
||||
* This big multiline macro makes all the other macros easier to read.
|
||||
**/
|
||||
|
||||
#define LOG_MACRO(isAsynchronous, lvl, flg, ctx, atag, fnct, frmt, ...) \
|
||||
[DDLog log:isAsynchronous \
|
||||
level:lvl \
|
||||
flag:flg \
|
||||
context:ctx \
|
||||
file:__FILE__ \
|
||||
function:fnct \
|
||||
line:__LINE__ \
|
||||
tag:atag \
|
||||
format:(frmt), ##__VA_ARGS__]
|
||||
|
||||
/**
|
||||
* Define the Objective-C and C versions of the macro.
|
||||
* These automatically inject the proper function name for either an objective-c method or c function.
|
||||
*
|
||||
* We also define shorthand versions for asynchronous and synchronous logging.
|
||||
**/
|
||||
|
||||
#define LOG_OBJC_MACRO(async, lvl, flg, ctx, frmt, ...) \
|
||||
LOG_MACRO(async, lvl, flg, ctx, nil, sel_getName(_cmd), frmt, ##__VA_ARGS__)
|
||||
|
||||
#define LOG_C_MACRO(async, lvl, flg, ctx, frmt, ...) \
|
||||
LOG_MACRO(async, lvl, flg, ctx, nil, __FUNCTION__, frmt, ##__VA_ARGS__)
|
||||
|
||||
#define SYNC_LOG_OBJC_MACRO(lvl, flg, ctx, frmt, ...) \
|
||||
LOG_OBJC_MACRO( NO, lvl, flg, ctx, frmt, ##__VA_ARGS__)
|
||||
|
||||
#define ASYNC_LOG_OBJC_MACRO(lvl, flg, ctx, frmt, ...) \
|
||||
LOG_OBJC_MACRO(YES, lvl, flg, ctx, frmt, ##__VA_ARGS__)
|
||||
|
||||
#define SYNC_LOG_C_MACRO(lvl, flg, ctx, frmt, ...) \
|
||||
LOG_C_MACRO( NO, lvl, flg, ctx, frmt, ##__VA_ARGS__)
|
||||
|
||||
#define ASYNC_LOG_C_MACRO(lvl, flg, ctx, frmt, ...) \
|
||||
LOG_C_MACRO(YES, lvl, flg, ctx, frmt, ##__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* Define version of the macro that only execute if the logLevel is above the threshold.
|
||||
* The compiled versions essentially look like this:
|
||||
*
|
||||
* if (logFlagForThisLogMsg & ddLogLevel) { execute log message }
|
||||
*
|
||||
* When LOG_LEVEL_DEF is defined as ddLogLevel.
|
||||
*
|
||||
* As shown further below, Lumberjack actually uses a bitmask as opposed to primitive log levels.
|
||||
* This allows for a great amount of flexibility and some pretty advanced fine grained logging techniques.
|
||||
*
|
||||
* Note that when compiler optimizations are enabled (as they are for your release builds),
|
||||
* the log messages above your logging threshold will automatically be compiled out.
|
||||
*
|
||||
* (If the compiler sees ddLogLevel declared as a constant, the compiler simply checks to see if the 'if' statement
|
||||
* would execute, and if not it strips it from the binary.)
|
||||
*
|
||||
* We also define shorthand versions for asynchronous and synchronous logging.
|
||||
**/
|
||||
|
||||
#define LOG_MAYBE(async, lvl, flg, ctx, fnct, frmt, ...) \
|
||||
do { if(lvl & flg) LOG_MACRO(async, lvl, flg, ctx, nil, fnct, frmt, ##__VA_ARGS__); } while(0)
|
||||
|
||||
#define LOG_OBJC_MAYBE(async, lvl, flg, ctx, frmt, ...) \
|
||||
LOG_MAYBE(async, lvl, flg, ctx, sel_getName(_cmd), frmt, ##__VA_ARGS__)
|
||||
|
||||
#define LOG_C_MAYBE(async, lvl, flg, ctx, frmt, ...) \
|
||||
LOG_MAYBE(async, lvl, flg, ctx, __FUNCTION__, frmt, ##__VA_ARGS__)
|
||||
|
||||
#define SYNC_LOG_OBJC_MAYBE(lvl, flg, ctx, frmt, ...) \
|
||||
LOG_OBJC_MAYBE( NO, lvl, flg, ctx, frmt, ##__VA_ARGS__)
|
||||
|
||||
#define ASYNC_LOG_OBJC_MAYBE(lvl, flg, ctx, frmt, ...) \
|
||||
LOG_OBJC_MAYBE(YES, lvl, flg, ctx, frmt, ##__VA_ARGS__)
|
||||
|
||||
#define SYNC_LOG_C_MAYBE(lvl, flg, ctx, frmt, ...) \
|
||||
LOG_C_MAYBE( NO, lvl, flg, ctx, frmt, ##__VA_ARGS__)
|
||||
|
||||
#define ASYNC_LOG_C_MAYBE(lvl, flg, ctx, frmt, ...) \
|
||||
LOG_C_MAYBE(YES, lvl, flg, ctx, frmt, ##__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* Define versions of the macros that also accept tags.
|
||||
*
|
||||
* The DDLogMessage object includes a 'tag' ivar that may be used for a variety of purposes.
|
||||
* It may be used to pass custom information to loggers or formatters.
|
||||
* Or it may be used by 3rd party extensions to the framework.
|
||||
*
|
||||
* Thes macros just make it a little easier to extend logging functionality.
|
||||
**/
|
||||
|
||||
#define LOG_OBJC_TAG_MACRO(async, lvl, flg, ctx, tag, frmt, ...) \
|
||||
LOG_MACRO(async, lvl, flg, ctx, tag, sel_getName(_cmd), frmt, ##__VA_ARGS__)
|
||||
|
||||
#define LOG_C_TAG_MACRO(async, lvl, flg, ctx, tag, frmt, ...) \
|
||||
LOG_MACRO(async, lvl, flg, ctx, tag, __FUNCTION__, frmt, ##__VA_ARGS__)
|
||||
|
||||
#define LOG_TAG_MAYBE(async, lvl, flg, ctx, tag, fnct, frmt, ...) \
|
||||
do { if(lvl & flg) LOG_MACRO(async, lvl, flg, ctx, tag, fnct, frmt, ##__VA_ARGS__); } while(0)
|
||||
|
||||
#define LOG_OBJC_TAG_MAYBE(async, lvl, flg, ctx, tag, frmt, ...) \
|
||||
LOG_TAG_MAYBE(async, lvl, flg, ctx, tag, sel_getName(_cmd), frmt, ##__VA_ARGS__)
|
||||
|
||||
#define LOG_C_TAG_MAYBE(async, lvl, flg, ctx, tag, frmt, ...) \
|
||||
LOG_TAG_MAYBE(async, lvl, flg, ctx, tag, __FUNCTION__, frmt, ##__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* Define the standard options.
|
||||
*
|
||||
* We default to only 4 levels because it makes it easier for beginners
|
||||
* to make the transition to a logging framework.
|
||||
*
|
||||
* More advanced users may choose to completely customize the levels (and level names) to suite their needs.
|
||||
* For more information on this see the "Custom Log Levels" page:
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomLogLevels
|
||||
*
|
||||
* Advanced users may also notice that we're using a bitmask.
|
||||
* This is to allow for custom fine grained logging:
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/FineGrainedLogging
|
||||
*
|
||||
* -- Flags --
|
||||
*
|
||||
* Typically you will use the LOG_LEVELS (see below), but the flags may be used directly in certain situations.
|
||||
* For example, say you have a lot of warning log messages, and you wanted to disable them.
|
||||
* However, you still needed to see your error and info log messages.
|
||||
* You could accomplish that with the following:
|
||||
*
|
||||
* static const int ddLogLevel = LOG_FLAG_ERROR | LOG_FLAG_INFO;
|
||||
*
|
||||
* When LOG_LEVEL_DEF is defined as ddLogLevel.
|
||||
*
|
||||
* Flags may also be consulted when writing custom log formatters,
|
||||
* as the DDLogMessage class captures the individual flag that caused the log message to fire.
|
||||
*
|
||||
* -- Levels --
|
||||
*
|
||||
* Log levels are simply the proper bitmask of the flags.
|
||||
*
|
||||
* -- Booleans --
|
||||
*
|
||||
* The booleans may be used when your logging code involves more than one line.
|
||||
* For example:
|
||||
*
|
||||
* if (LOG_VERBOSE) {
|
||||
* for (id sprocket in sprockets)
|
||||
* DDLogVerbose(@"sprocket: %@", [sprocket description])
|
||||
* }
|
||||
*
|
||||
* -- Async --
|
||||
*
|
||||
* Defines the default asynchronous options.
|
||||
* The default philosophy for asynchronous logging is very simple:
|
||||
*
|
||||
* Log messages with errors should be executed synchronously.
|
||||
* After all, an error just occurred. The application could be unstable.
|
||||
*
|
||||
* All other log messages, such as debug output, are executed asynchronously.
|
||||
* After all, if it wasn't an error, then it was just informational output,
|
||||
* or something the application was easily able to recover from.
|
||||
*
|
||||
* -- Changes --
|
||||
*
|
||||
* You are strongly discouraged from modifying this file.
|
||||
* If you do, you make it more difficult on yourself to merge future bug fixes and improvements from the project.
|
||||
* Instead, create your own MyLogging.h or ApplicationNameLogging.h or CompanyLogging.h
|
||||
*
|
||||
* For an example of customizing your logging experience, see the "Custom Log Levels" page:
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomLogLevels
|
||||
**/
|
||||
|
||||
#define LOG_FLAG_ERROR (1 << 0) // 0...00001
|
||||
#define LOG_FLAG_WARN (1 << 1) // 0...00010
|
||||
#define LOG_FLAG_INFO (1 << 2) // 0...00100
|
||||
#define LOG_FLAG_DEBUG (1 << 3) // 0...01000
|
||||
#define LOG_FLAG_VERBOSE (1 << 4) // 0...10000
|
||||
|
||||
#define LOG_LEVEL_OFF 0
|
||||
#define LOG_LEVEL_ERROR (LOG_FLAG_ERROR) // 0...00001
|
||||
#define LOG_LEVEL_WARN (LOG_FLAG_ERROR | LOG_FLAG_WARN) // 0...00011
|
||||
#define LOG_LEVEL_INFO (LOG_FLAG_ERROR | LOG_FLAG_WARN | LOG_FLAG_INFO) // 0...00111
|
||||
#define LOG_LEVEL_DEBUG (LOG_FLAG_ERROR | LOG_FLAG_WARN | LOG_FLAG_INFO | LOG_FLAG_DEBUG) // 0...01111
|
||||
#define LOG_LEVEL_VERBOSE (LOG_FLAG_ERROR | LOG_FLAG_WARN | LOG_FLAG_INFO | LOG_FLAG_DEBUG | LOG_FLAG_VERBOSE) // 0...11111
|
||||
|
||||
#define LOG_ERROR (LOG_LEVEL_DEF & LOG_FLAG_ERROR)
|
||||
#define LOG_WARN (LOG_LEVEL_DEF & LOG_FLAG_WARN)
|
||||
#define LOG_INFO (LOG_LEVEL_DEF & LOG_FLAG_INFO)
|
||||
#define LOG_DEBUG (LOG_LEVEL_DEF & LOG_FLAG_DEBUG)
|
||||
#define LOG_VERBOSE (LOG_LEVEL_DEF & LOG_FLAG_VERBOSE)
|
||||
|
||||
#define LOG_ASYNC_ENABLED YES
|
||||
|
||||
#define LOG_ASYNC_ERROR ( NO && LOG_ASYNC_ENABLED)
|
||||
#define LOG_ASYNC_WARN (YES && LOG_ASYNC_ENABLED)
|
||||
#define LOG_ASYNC_INFO (YES && LOG_ASYNC_ENABLED)
|
||||
#define LOG_ASYNC_DEBUG (YES && LOG_ASYNC_ENABLED)
|
||||
#define LOG_ASYNC_VERBOSE (YES && LOG_ASYNC_ENABLED)
|
||||
|
||||
#define DDLogError(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_ERROR, LOG_LEVEL_DEF, LOG_FLAG_ERROR, 0, frmt, ##__VA_ARGS__)
|
||||
#define DDLogWarn(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_WARN, LOG_LEVEL_DEF, LOG_FLAG_WARN, 0, frmt, ##__VA_ARGS__)
|
||||
#define DDLogInfo(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_INFO, LOG_LEVEL_DEF, LOG_FLAG_INFO, 0, frmt, ##__VA_ARGS__)
|
||||
#define DDLogDebug(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_DEBUG, LOG_LEVEL_DEF, LOG_FLAG_DEBUG, 0, frmt, ##__VA_ARGS__)
|
||||
#define DDLogVerbose(frmt, ...) LOG_OBJC_MAYBE(LOG_ASYNC_VERBOSE, LOG_LEVEL_DEF, LOG_FLAG_VERBOSE, 0, frmt, ##__VA_ARGS__)
|
||||
|
||||
#define DDLogCError(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_ERROR, LOG_LEVEL_DEF, LOG_FLAG_ERROR, 0, frmt, ##__VA_ARGS__)
|
||||
#define DDLogCWarn(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_WARN, LOG_LEVEL_DEF, LOG_FLAG_WARN, 0, frmt, ##__VA_ARGS__)
|
||||
#define DDLogCInfo(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_INFO, LOG_LEVEL_DEF, LOG_FLAG_INFO, 0, frmt, ##__VA_ARGS__)
|
||||
#define DDLogCDebug(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_DEBUG, LOG_LEVEL_DEF, LOG_FLAG_DEBUG, 0, frmt, ##__VA_ARGS__)
|
||||
#define DDLogCVerbose(frmt, ...) LOG_C_MAYBE(LOG_ASYNC_VERBOSE, LOG_LEVEL_DEF, LOG_FLAG_VERBOSE, 0, frmt, ##__VA_ARGS__)
|
||||
|
||||
/**
|
||||
* The THIS_FILE macro gives you an NSString of the file name.
|
||||
* For simplicity and clarity, the file name does not include the full path or file extension.
|
||||
*
|
||||
* For example: DDLogWarn(@"%@: Unable to find thingy", THIS_FILE) -> @"MyViewController: Unable to find thingy"
|
||||
**/
|
||||
|
||||
NSString *DDExtractFileNameWithoutExtension(const char *filePath, BOOL copy);
|
||||
|
||||
#define THIS_FILE (DDExtractFileNameWithoutExtension(__FILE__, NO))
|
||||
|
||||
/**
|
||||
* The THIS_METHOD macro gives you the name of the current objective-c method.
|
||||
*
|
||||
* For example: DDLogWarn(@"%@ - Requires non-nil strings", THIS_METHOD) -> @"setMake:model: requires non-nil strings"
|
||||
*
|
||||
* Note: This does NOT work in straight C functions (non objective-c).
|
||||
* Instead you should use the predefined __FUNCTION__ macro.
|
||||
**/
|
||||
|
||||
#define THIS_METHOD NSStringFromSelector(_cmd)
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface DDLog : NSObject
|
||||
|
||||
/**
|
||||
* Provides access to the underlying logging queue.
|
||||
* This may be helpful to Logger classes for things like thread synchronization.
|
||||
**/
|
||||
|
||||
+ (dispatch_queue_t)loggingQueue;
|
||||
|
||||
/**
|
||||
* Logging Primitive.
|
||||
*
|
||||
* This method is used by the macros above.
|
||||
* It is suggested you stick with the macros as they're easier to use.
|
||||
**/
|
||||
|
||||
+ (void)log:(BOOL)synchronous
|
||||
level:(int)level
|
||||
flag:(int)flag
|
||||
context:(int)context
|
||||
file:(const char *)file
|
||||
function:(const char *)function
|
||||
line:(int)line
|
||||
tag:(id)tag
|
||||
format:(NSString *)format, ... __attribute__ ((format (__NSString__, 9, 10)));
|
||||
|
||||
/**
|
||||
* Logging Primitive.
|
||||
*
|
||||
* This method can be used if you have a prepared va_list.
|
||||
**/
|
||||
|
||||
+ (void)log:(BOOL)asynchronous
|
||||
level:(int)level
|
||||
flag:(int)flag
|
||||
context:(int)context
|
||||
file:(const char *)file
|
||||
function:(const char *)function
|
||||
line:(int)line
|
||||
tag:(id)tag
|
||||
format:(NSString *)format
|
||||
args:(va_list)argList;
|
||||
|
||||
|
||||
/**
|
||||
* Since logging can be asynchronous, there may be times when you want to flush the logs.
|
||||
* The framework invokes this automatically when the application quits.
|
||||
**/
|
||||
|
||||
+ (void)flushLog;
|
||||
|
||||
/**
|
||||
* Loggers
|
||||
*
|
||||
* If you want your log statements to go somewhere,
|
||||
* you should create and add a logger.
|
||||
**/
|
||||
|
||||
+ (void)addLogger:(id <DDLogger>)logger; // adds the logger using maximum log level (LOG_LEVEL_VERBOSE)
|
||||
|
||||
/**
|
||||
* Please use as logLevels the LOG_LEVEL_* macros
|
||||
*
|
||||
**/
|
||||
+ (void)addLogger:(id <DDLogger>)logger withLogLevel:(int)logLevel;
|
||||
|
||||
+ (void)removeLogger:(id <DDLogger>)logger;
|
||||
+ (void)removeAllLoggers;
|
||||
|
||||
+ (NSArray *)allLoggers;
|
||||
|
||||
/**
|
||||
* Registered Dynamic Logging
|
||||
*
|
||||
* These methods allow you to obtain a list of classes that are using registered dynamic logging,
|
||||
* and also provides methods to get and set their log level during run time.
|
||||
**/
|
||||
|
||||
+ (NSArray *)registeredClasses;
|
||||
+ (NSArray *)registeredClassNames;
|
||||
|
||||
+ (int)logLevelForClass:(Class)aClass;
|
||||
+ (int)logLevelForClassWithName:(NSString *)aClassName;
|
||||
|
||||
+ (void)setLogLevel:(int)logLevel forClass:(Class)aClass;
|
||||
+ (void)setLogLevel:(int)logLevel forClassWithName:(NSString *)aClassName;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@protocol DDLogger <NSObject>
|
||||
@required
|
||||
|
||||
- (void)logMessage:(DDLogMessage *)logMessage;
|
||||
|
||||
/**
|
||||
* Formatters may optionally be added to any logger.
|
||||
*
|
||||
* If no formatter is set, the logger simply logs the message as it is given in logMessage,
|
||||
* or it may use its own built in formatting style.
|
||||
**/
|
||||
- (id <DDLogFormatter>)logFormatter;
|
||||
- (void)setLogFormatter:(id <DDLogFormatter>)formatter;
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
* Since logging is asynchronous, adding and removing loggers is also asynchronous.
|
||||
* In other words, the loggers are added and removed at appropriate times with regards to log messages.
|
||||
*
|
||||
* - Loggers will not receive log messages that were executed prior to when they were added.
|
||||
* - Loggers will not receive log messages that were executed after they were removed.
|
||||
*
|
||||
* These methods are executed in the logging thread/queue.
|
||||
* This is the same thread/queue that will execute every logMessage: invocation.
|
||||
* Loggers may use these methods for thread synchronization or other setup/teardown tasks.
|
||||
**/
|
||||
- (void)didAddLogger;
|
||||
- (void)willRemoveLogger;
|
||||
|
||||
/**
|
||||
* Some loggers may buffer IO for optimization purposes.
|
||||
* For example, a database logger may only save occasionaly as the disk IO is slow.
|
||||
* In such loggers, this method should be implemented to flush any pending IO.
|
||||
*
|
||||
* This allows invocations of DDLog's flushLog method to be propogated to loggers that need it.
|
||||
*
|
||||
* Note that DDLog's flushLog method is invoked automatically when the application quits,
|
||||
* and it may be also invoked manually by the developer prior to application crashes, or other such reasons.
|
||||
**/
|
||||
- (void)flush;
|
||||
|
||||
/**
|
||||
* Each logger is executed concurrently with respect to the other loggers.
|
||||
* Thus, a dedicated dispatch queue is used for each logger.
|
||||
* Logger implementations may optionally choose to provide their own dispatch queue.
|
||||
**/
|
||||
- (dispatch_queue_t)loggerQueue;
|
||||
|
||||
/**
|
||||
* If the logger implementation does not choose to provide its own queue,
|
||||
* one will automatically be created for it.
|
||||
* The created queue will receive its name from this method.
|
||||
* This may be helpful for debugging or profiling reasons.
|
||||
**/
|
||||
- (NSString *)loggerName;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@protocol DDLogFormatter <NSObject>
|
||||
@required
|
||||
|
||||
/**
|
||||
* Formatters may optionally be added to any logger.
|
||||
* This allows for increased flexibility in the logging environment.
|
||||
* For example, log messages for log files may be formatted differently than log messages for the console.
|
||||
*
|
||||
* For more information about formatters, see the "Custom Formatters" page:
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters
|
||||
*
|
||||
* The formatter may also optionally filter the log message by returning nil,
|
||||
* in which case the logger will not log the message.
|
||||
**/
|
||||
- (NSString *)formatLogMessage:(DDLogMessage *)logMessage;
|
||||
|
||||
@optional
|
||||
|
||||
/**
|
||||
* A single formatter instance can be added to multiple loggers.
|
||||
* These methods provides hooks to notify the formatter of when it's added/removed.
|
||||
*
|
||||
* This is primarily for thread-safety.
|
||||
* If a formatter is explicitly not thread-safe, it may wish to throw an exception if added to multiple loggers.
|
||||
* Or if a formatter has potentially thread-unsafe code (e.g. NSDateFormatter),
|
||||
* it could possibly use these hooks to switch to thread-safe versions of the code.
|
||||
**/
|
||||
- (void)didAddToLogger:(id <DDLogger>)logger;
|
||||
- (void)willRemoveFromLogger:(id <DDLogger>)logger;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@protocol DDRegisteredDynamicLogging
|
||||
|
||||
/**
|
||||
* Implement these methods to allow a file's log level to be managed from a central location.
|
||||
*
|
||||
* This is useful if you'd like to be able to change log levels for various parts
|
||||
* of your code from within the running application.
|
||||
*
|
||||
* Imagine pulling up the settings for your application,
|
||||
* and being able to configure the logging level on a per file basis.
|
||||
*
|
||||
* The implementation can be very straight-forward:
|
||||
*
|
||||
* + (int)ddLogLevel
|
||||
* {
|
||||
* return ddLogLevel;
|
||||
* }
|
||||
*
|
||||
* + (void)ddSetLogLevel:(int)logLevel
|
||||
* {
|
||||
* ddLogLevel = logLevel;
|
||||
* }
|
||||
**/
|
||||
|
||||
+ (int)ddLogLevel;
|
||||
+ (void)ddSetLogLevel:(int)logLevel;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* The DDLogMessage class encapsulates information about the log message.
|
||||
* If you write custom loggers or formatters, you will be dealing with objects of this class.
|
||||
**/
|
||||
|
||||
enum {
|
||||
DDLogMessageCopyFile = 1 << 0,
|
||||
DDLogMessageCopyFunction = 1 << 1
|
||||
};
|
||||
typedef int DDLogMessageOptions;
|
||||
|
||||
@interface DDLogMessage : NSObject <NSCopying>
|
||||
{
|
||||
|
||||
// The public variables below can be accessed directly (for speed).
|
||||
// For example: logMessage->logLevel
|
||||
|
||||
@public
|
||||
int logLevel;
|
||||
int logFlag;
|
||||
int logContext;
|
||||
NSString *logMsg;
|
||||
NSDate *timestamp;
|
||||
char *file;
|
||||
char *function;
|
||||
int lineNumber;
|
||||
mach_port_t machThreadID;
|
||||
char *queueLabel;
|
||||
NSString *threadName;
|
||||
|
||||
// For 3rd party extensions to the framework, where flags and contexts aren't enough.
|
||||
id tag;
|
||||
|
||||
// For 3rd party extensions that manually create DDLogMessage instances.
|
||||
DDLogMessageOptions options;
|
||||
}
|
||||
|
||||
/**
|
||||
* Standard init method for a log message object.
|
||||
* Used by the logging primitives. (And the macros use the logging primitives.)
|
||||
*
|
||||
* If you find need to manually create logMessage objects, there is one thing you should be aware of:
|
||||
*
|
||||
* If no flags are passed, the method expects the file and function parameters to be string literals.
|
||||
* That is, it expects the given strings to exist for the duration of the object's lifetime,
|
||||
* and it expects the given strings to be immutable.
|
||||
* In other words, it does not copy these strings, it simply points to them.
|
||||
* This is due to the fact that __FILE__ and __FUNCTION__ are usually used to specify these parameters,
|
||||
* so it makes sense to optimize and skip the unnecessary allocations.
|
||||
* However, if you need them to be copied you may use the options parameter to specify this.
|
||||
* Options is a bitmask which supports DDLogMessageCopyFile and DDLogMessageCopyFunction.
|
||||
**/
|
||||
- (instancetype)initWithLogMsg:(NSString *)logMsg
|
||||
level:(int)logLevel
|
||||
flag:(int)logFlag
|
||||
context:(int)logContext
|
||||
file:(const char *)file
|
||||
function:(const char *)function
|
||||
line:(int)line
|
||||
tag:(id)tag
|
||||
options:(DDLogMessageOptions)optionsMask;
|
||||
|
||||
/**
|
||||
* Returns the threadID as it appears in NSLog.
|
||||
* That is, it is a hexadecimal value which is calculated from the machThreadID.
|
||||
**/
|
||||
- (NSString *)threadID;
|
||||
|
||||
/**
|
||||
* Convenience property to get just the file name, as the file variable is generally the full file path.
|
||||
* This method does not include the file extension, which is generally unwanted for logging purposes.
|
||||
**/
|
||||
- (NSString *)fileName;
|
||||
|
||||
/**
|
||||
* Returns the function variable in NSString form.
|
||||
**/
|
||||
- (NSString *)methodName;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* The DDLogger protocol specifies that an optional formatter can be added to a logger.
|
||||
* Most (but not all) loggers will want to support formatters.
|
||||
*
|
||||
* However, writting getters and setters in a thread safe manner,
|
||||
* while still maintaining maximum speed for the logging process, is a difficult task.
|
||||
*
|
||||
* To do it right, the implementation of the getter/setter has strict requiremenets:
|
||||
* - Must NOT require the logMessage method to acquire a lock.
|
||||
* - Must NOT require the logMessage method to access an atomic property (also a lock of sorts).
|
||||
*
|
||||
* To simplify things, an abstract logger is provided that implements the getter and setter.
|
||||
*
|
||||
* Logger implementations may simply extend this class,
|
||||
* and they can ACCESS THE FORMATTER VARIABLE DIRECTLY from within their logMessage method!
|
||||
**/
|
||||
|
||||
@interface DDAbstractLogger : NSObject <DDLogger>
|
||||
{
|
||||
id <DDLogFormatter> formatter;
|
||||
|
||||
dispatch_queue_t loggerQueue;
|
||||
}
|
||||
|
||||
- (id <DDLogFormatter>)logFormatter;
|
||||
- (void)setLogFormatter:(id <DDLogFormatter>)formatter;
|
||||
|
||||
// For thread-safety assertions
|
||||
- (BOOL)isOnGlobalLoggingQueue;
|
||||
- (BOOL)isOnInternalLoggerQueue;
|
||||
|
||||
@end
|
||||
@@ -1,181 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#if TARGET_OS_IPHONE
|
||||
#import <UIKit/UIColor.h> // iOS
|
||||
#elif !defined (COCOAPODS_POD_AVAILABLE_CocoaLumberjack_CLI)
|
||||
#import <AppKit/NSColor.h> // OS X with AppKit
|
||||
#else
|
||||
#import "CLIColor.h" // OS X without AppKit
|
||||
#endif
|
||||
|
||||
#import "DDLog.h"
|
||||
|
||||
#define LOG_CONTEXT_ALL INT_MAX
|
||||
|
||||
/**
|
||||
* Welcome to Cocoa Lumberjack!
|
||||
*
|
||||
* The project page has a wealth of documentation if you have any questions.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
||||
*
|
||||
*
|
||||
* This class provides a logger for Terminal output or Xcode console output,
|
||||
* depending on where you are running your code.
|
||||
*
|
||||
* As described in the "Getting Started" page,
|
||||
* the traditional NSLog() function directs it's output to two places:
|
||||
*
|
||||
* - Apple System Log (so it shows up in Console.app)
|
||||
* - StdErr (if stderr is a TTY, so log statements show up in Xcode console)
|
||||
*
|
||||
* To duplicate NSLog() functionality you can simply add this logger and an asl logger.
|
||||
* However, if you instead choose to use file logging (for faster performance),
|
||||
* you may choose to use only a file logger and a tty logger.
|
||||
**/
|
||||
|
||||
@interface DDTTYLogger : DDAbstractLogger <DDLogger>
|
||||
{
|
||||
NSCalendar *calendar;
|
||||
NSUInteger calendarUnitFlags;
|
||||
|
||||
NSString *appName;
|
||||
char *app;
|
||||
size_t appLen;
|
||||
|
||||
NSString *processID;
|
||||
char *pid;
|
||||
size_t pidLen;
|
||||
|
||||
BOOL colorsEnabled;
|
||||
NSMutableArray *colorProfilesArray;
|
||||
NSMutableDictionary *colorProfilesDict;
|
||||
}
|
||||
|
||||
+ (instancetype)sharedInstance;
|
||||
|
||||
/* Inherited from the DDLogger protocol:
|
||||
*
|
||||
* Formatters may optionally be added to any logger.
|
||||
*
|
||||
* If no formatter is set, the logger simply logs the message as it is given in logMessage,
|
||||
* or it may use its own built in formatting style.
|
||||
*
|
||||
* More information about formatters can be found here:
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters
|
||||
*
|
||||
* The actual implementation of these methods is inherited from DDAbstractLogger.
|
||||
|
||||
- (id <DDLogFormatter>)logFormatter;
|
||||
- (void)setLogFormatter:(id <DDLogFormatter>)formatter;
|
||||
|
||||
*/
|
||||
|
||||
/**
|
||||
* Want to use different colors for different log levels?
|
||||
* Enable this property.
|
||||
*
|
||||
* If you run the application via the Terminal (not Xcode),
|
||||
* the logger will map colors to xterm-256color or xterm-color (if available).
|
||||
*
|
||||
* Xcode does NOT natively support colors in the Xcode debugging console.
|
||||
* You'll need to install the XcodeColors plugin to see colors in the Xcode console.
|
||||
* https://github.com/robbiehanson/XcodeColors
|
||||
*
|
||||
* The default value if NO.
|
||||
**/
|
||||
@property (readwrite, assign) BOOL colorsEnabled;
|
||||
|
||||
/**
|
||||
* The default color set (foregroundColor, backgroundColor) is:
|
||||
*
|
||||
* - LOG_FLAG_ERROR = (red, nil)
|
||||
* - LOG_FLAG_WARN = (orange, nil)
|
||||
*
|
||||
* You can customize the colors however you see fit.
|
||||
* Please note that you are passing a flag, NOT a level.
|
||||
*
|
||||
* GOOD : [ttyLogger setForegroundColor:pink backgroundColor:nil forFlag:LOG_FLAG_INFO]; // <- Good :)
|
||||
* BAD : [ttyLogger setForegroundColor:pink backgroundColor:nil forFlag:LOG_LEVEL_INFO]; // <- BAD! :(
|
||||
*
|
||||
* LOG_FLAG_INFO = 0...00100
|
||||
* LOG_LEVEL_INFO = 0...00111 <- Would match LOG_FLAG_INFO and LOG_FLAG_WARN and LOG_FLAG_ERROR
|
||||
*
|
||||
* If you run the application within Xcode, then the XcodeColors plugin is required.
|
||||
*
|
||||
* If you run the application from a shell, then DDTTYLogger will automatically map the given color to
|
||||
* the closest available color. (xterm-256color or xterm-color which have 256 and 16 supported colors respectively.)
|
||||
*
|
||||
* This method invokes setForegroundColor:backgroundColor:forFlag:context: and applies it to `LOG_CONTEXT_ALL`.
|
||||
**/
|
||||
#if TARGET_OS_IPHONE
|
||||
- (void)setForegroundColor:(UIColor *)txtColor backgroundColor:(UIColor *)bgColor forFlag:(int)mask;
|
||||
#elif !defined (COCOAPODS_POD_AVAILABLE_CocoaLumberjack_CLI)
|
||||
- (void)setForegroundColor:(NSColor *)txtColor backgroundColor:(NSColor *)bgColor forFlag:(int)mask;
|
||||
#else
|
||||
- (void)setForegroundColor:(CLIColor *)txtColor backgroundColor:(CLIColor *)bgColor forFlag:(int)mask;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Just like setForegroundColor:backgroundColor:flag, but allows you to specify a particular logging context.
|
||||
*
|
||||
* A logging context is often used to identify log messages coming from a 3rd party framework,
|
||||
* although logging context's can be used for many different functions.
|
||||
*
|
||||
* Use LOG_CONTEXT_ALL to set the deafult color for all contexts that have no specific color set defined.
|
||||
*
|
||||
* Logging context's are explained in further detail here:
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomContext
|
||||
**/
|
||||
#if TARGET_OS_IPHONE
|
||||
- (void)setForegroundColor:(UIColor *)txtColor backgroundColor:(UIColor *)bgColor forFlag:(int)mask context:(int)ctxt;
|
||||
#elif !defined (COCOAPODS_POD_AVAILABLE_CocoaLumberjack_CLI)
|
||||
- (void)setForegroundColor:(NSColor *)txtColor backgroundColor:(NSColor *)bgColor forFlag:(int)mask context:(int)ctxt;
|
||||
#else
|
||||
- (void)setForegroundColor:(CLIColor *)txtColor backgroundColor:(CLIColor *)bgColor forFlag:(int)mask context:(int)ctxt;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Similar to the methods above, but allows you to map DDLogMessage->tag to a particular color profile.
|
||||
* For example, you could do something like this:
|
||||
*
|
||||
* static NSString *const PurpleTag = @"PurpleTag";
|
||||
*
|
||||
* #define DDLogPurple(frmt, ...) LOG_OBJC_TAG_MACRO(NO, 0, 0, 0, PurpleTag, frmt, ##__VA_ARGS__)
|
||||
*
|
||||
* And then in your applicationDidFinishLaunching, or wherever you configure Lumberjack:
|
||||
*
|
||||
* #if TARGET_OS_IPHONE
|
||||
* UIColor *purple = [UIColor colorWithRed:(64/255.0) green:(0/255.0) blue:(128/255.0) alpha:1.0];
|
||||
* #else
|
||||
* NSColor *purple = [NSColor colorWithCalibratedRed:(64/255.0) green:(0/255.0) blue:(128/255.0) alpha:1.0];
|
||||
*
|
||||
* Note: For CLI OS X projects that don't link with AppKit use CLIColor objects instead
|
||||
*
|
||||
* [[DDTTYLogger sharedInstance] setForegroundColor:purple backgroundColor:nil forTag:PurpleTag];
|
||||
* [DDLog addLogger:[DDTTYLogger sharedInstance]];
|
||||
*
|
||||
* This would essentially give you a straight NSLog replacement that prints in purple:
|
||||
*
|
||||
* DDLogPurple(@"I'm a purple log message!");
|
||||
**/
|
||||
#if TARGET_OS_IPHONE
|
||||
- (void)setForegroundColor:(UIColor *)txtColor backgroundColor:(UIColor *)bgColor forTag:(id <NSCopying>)tag;
|
||||
#elif !defined (COCOAPODS_POD_AVAILABLE_CocoaLumberjack_CLI)
|
||||
- (void)setForegroundColor:(NSColor *)txtColor backgroundColor:(NSColor *)bgColor forTag:(id <NSCopying>)tag;
|
||||
#else
|
||||
- (void)setForegroundColor:(CLIColor *)txtColor backgroundColor:(CLIColor *)bgColor forTag:(id <NSCopying>)tag;
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Clearing color profiles.
|
||||
**/
|
||||
- (void)clearColorsForFlag:(int)mask;
|
||||
- (void)clearColorsForFlag:(int)mask context:(int)context;
|
||||
- (void)clearColorsForTag:(id <NSCopying>)tag;
|
||||
- (void)clearColorsForAllFlags;
|
||||
- (void)clearColorsForAllTags;
|
||||
- (void)clearAllColors;
|
||||
|
||||
@end
|
||||
@@ -1,63 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "DDLog.h"
|
||||
|
||||
/**
|
||||
* Welcome to Cocoa Lumberjack!
|
||||
*
|
||||
* The project page has a wealth of documentation if you have any questions.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" page.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
||||
*
|
||||
*
|
||||
* This class provides a log formatter that filters log statements from a logging context not on the whitelist.
|
||||
*
|
||||
* A log formatter can be added to any logger to format and/or filter its output.
|
||||
* You can learn more about log formatters here:
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters
|
||||
*
|
||||
* You can learn more about logging context's here:
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomContext
|
||||
*
|
||||
* But here's a quick overview / refresher:
|
||||
*
|
||||
* Every log statement has a logging context.
|
||||
* These come from the underlying logging macros defined in DDLog.h.
|
||||
* The default logging context is zero.
|
||||
* You can define multiple logging context's for use in your application.
|
||||
* For example, logically separate parts of your app each have a different logging context.
|
||||
* Also 3rd party frameworks that make use of Lumberjack generally use their own dedicated logging context.
|
||||
**/
|
||||
@interface DDContextWhitelistFilterLogFormatter : NSObject <DDLogFormatter>
|
||||
|
||||
- (id)init;
|
||||
|
||||
- (void)addToWhitelist:(int)loggingContext;
|
||||
- (void)removeFromWhitelist:(int)loggingContext;
|
||||
|
||||
- (NSArray *)whitelist;
|
||||
|
||||
- (BOOL)isOnWhitelist:(int)loggingContext;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* This class provides a log formatter that filters log statements from a logging context on the blacklist.
|
||||
**/
|
||||
@interface DDContextBlacklistFilterLogFormatter : NSObject <DDLogFormatter>
|
||||
|
||||
- (id)init;
|
||||
|
||||
- (void)addToBlacklist:(int)loggingContext;
|
||||
- (void)removeFromBlacklist:(int)loggingContext;
|
||||
|
||||
- (NSArray *)blacklist;
|
||||
|
||||
- (BOOL)isOnBlacklist:(int)loggingContext;
|
||||
|
||||
@end
|
||||
@@ -1,191 +0,0 @@
|
||||
#import "DDContextFilterLogFormatter.h"
|
||||
#import <libkern/OSAtomic.h>
|
||||
|
||||
/**
|
||||
* Welcome to Cocoa Lumberjack!
|
||||
*
|
||||
* The project page has a wealth of documentation if you have any questions.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
||||
**/
|
||||
|
||||
#if ! __has_feature(objc_arc)
|
||||
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
||||
#endif
|
||||
|
||||
@interface DDLoggingContextSet : NSObject
|
||||
|
||||
- (void)addToSet:(int)loggingContext;
|
||||
- (void)removeFromSet:(int)loggingContext;
|
||||
|
||||
- (NSArray *)currentSet;
|
||||
|
||||
- (BOOL)isInSet:(int)loggingContext;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@implementation DDContextWhitelistFilterLogFormatter
|
||||
{
|
||||
DDLoggingContextSet *contextSet;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
contextSet = [[DDLoggingContextSet alloc] init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (void)addToWhitelist:(int)loggingContext
|
||||
{
|
||||
[contextSet addToSet:loggingContext];
|
||||
}
|
||||
|
||||
- (void)removeFromWhitelist:(int)loggingContext
|
||||
{
|
||||
[contextSet removeFromSet:loggingContext];
|
||||
}
|
||||
|
||||
- (NSArray *)whitelist
|
||||
{
|
||||
return [contextSet currentSet];
|
||||
}
|
||||
|
||||
- (BOOL)isOnWhitelist:(int)loggingContext
|
||||
{
|
||||
return [contextSet isInSet:loggingContext];
|
||||
}
|
||||
|
||||
- (NSString *)formatLogMessage:(DDLogMessage *)logMessage
|
||||
{
|
||||
if ([self isOnWhitelist:logMessage->logContext])
|
||||
return logMessage->logMsg;
|
||||
else
|
||||
return nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@implementation DDContextBlacklistFilterLogFormatter
|
||||
{
|
||||
DDLoggingContextSet *contextSet;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
contextSet = [[DDLoggingContextSet alloc] init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (void)addToBlacklist:(int)loggingContext
|
||||
{
|
||||
[contextSet addToSet:loggingContext];
|
||||
}
|
||||
|
||||
- (void)removeFromBlacklist:(int)loggingContext
|
||||
{
|
||||
[contextSet removeFromSet:loggingContext];
|
||||
}
|
||||
|
||||
- (NSArray *)blacklist
|
||||
{
|
||||
return [contextSet currentSet];
|
||||
}
|
||||
|
||||
- (BOOL)isOnBlacklist:(int)loggingContext
|
||||
{
|
||||
return [contextSet isInSet:loggingContext];
|
||||
}
|
||||
|
||||
- (NSString *)formatLogMessage:(DDLogMessage *)logMessage
|
||||
{
|
||||
if ([self isOnBlacklist:logMessage->logContext])
|
||||
return nil;
|
||||
else
|
||||
return logMessage->logMsg;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@implementation DDLoggingContextSet
|
||||
{
|
||||
OSSpinLock lock;
|
||||
NSMutableSet *set;
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
set = [[NSMutableSet alloc] init];
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
- (void)addToSet:(int)loggingContext
|
||||
{
|
||||
OSSpinLockLock(&lock);
|
||||
{
|
||||
[set addObject:@(loggingContext)];
|
||||
}
|
||||
OSSpinLockUnlock(&lock);
|
||||
}
|
||||
|
||||
- (void)removeFromSet:(int)loggingContext
|
||||
{
|
||||
OSSpinLockLock(&lock);
|
||||
{
|
||||
[set removeObject:@(loggingContext)];
|
||||
}
|
||||
OSSpinLockUnlock(&lock);
|
||||
}
|
||||
|
||||
- (NSArray *)currentSet
|
||||
{
|
||||
NSArray *result = nil;
|
||||
|
||||
OSSpinLockLock(&lock);
|
||||
{
|
||||
result = [set allObjects];
|
||||
}
|
||||
OSSpinLockUnlock(&lock);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (BOOL)isInSet:(int)loggingContext
|
||||
{
|
||||
BOOL result = NO;
|
||||
|
||||
OSSpinLockLock(&lock);
|
||||
{
|
||||
result = [set containsObject:@(loggingContext)];
|
||||
}
|
||||
OSSpinLockUnlock(&lock);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,128 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import <libkern/OSAtomic.h>
|
||||
#import "DDLog.h"
|
||||
|
||||
|
||||
/**
|
||||
* Welcome to Cocoa Lumberjack!
|
||||
*
|
||||
* The project page has a wealth of documentation if you have any questions.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" page.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
||||
*
|
||||
*
|
||||
* This class provides a log formatter that prints the dispatch_queue label instead of the mach_thread_id.
|
||||
*
|
||||
* A log formatter can be added to any logger to format and/or filter its output.
|
||||
* You can learn more about log formatters here:
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters
|
||||
*
|
||||
* A typical NSLog (or DDTTYLogger) prints detailed info as [<process_id>:<thread_id>].
|
||||
* For example:
|
||||
*
|
||||
* 2011-10-17 20:21:45.435 AppName[19928:5207] Your log message here
|
||||
*
|
||||
* Where:
|
||||
* - 19928 = process id
|
||||
* - 5207 = thread id (mach_thread_id printed in hex)
|
||||
*
|
||||
* When using grand central dispatch (GCD), this information is less useful.
|
||||
* This is because a single serial dispatch queue may be run on any thread from an internally managed thread pool.
|
||||
* For example:
|
||||
*
|
||||
* 2011-10-17 20:32:31.111 AppName[19954:4d07] Message from my_serial_dispatch_queue
|
||||
* 2011-10-17 20:32:31.112 AppName[19954:5207] Message from my_serial_dispatch_queue
|
||||
* 2011-10-17 20:32:31.113 AppName[19954:2c55] Message from my_serial_dispatch_queue
|
||||
*
|
||||
* This formatter allows you to replace the standard [box:info] with the dispatch_queue name.
|
||||
* For example:
|
||||
*
|
||||
* 2011-10-17 20:32:31.111 AppName[img-scaling] Message from my_serial_dispatch_queue
|
||||
* 2011-10-17 20:32:31.112 AppName[img-scaling] Message from my_serial_dispatch_queue
|
||||
* 2011-10-17 20:32:31.113 AppName[img-scaling] Message from my_serial_dispatch_queue
|
||||
*
|
||||
* If the dispatch_queue doesn't have a set name, then it falls back to the thread name.
|
||||
* If the current thread doesn't have a set name, then it falls back to the mach_thread_id in hex (like normal).
|
||||
*
|
||||
* Note: If manually creating your own background threads (via NSThread/alloc/init or NSThread/detachNeThread),
|
||||
* you can use [[NSThread currentThread] setName:(NSString *)].
|
||||
**/
|
||||
@interface DDDispatchQueueLogFormatter : NSObject <DDLogFormatter> {
|
||||
@protected
|
||||
|
||||
NSString *dateFormatString;
|
||||
}
|
||||
|
||||
/**
|
||||
* Standard init method.
|
||||
* Configure using properties as desired.
|
||||
**/
|
||||
- (id)init;
|
||||
|
||||
/**
|
||||
* The minQueueLength restricts the minimum size of the [detail box].
|
||||
* If the minQueueLength is set to 0, there is no restriction.
|
||||
*
|
||||
* For example, say a dispatch_queue has a label of "diskIO":
|
||||
*
|
||||
* If the minQueueLength is 0: [diskIO]
|
||||
* If the minQueueLength is 4: [diskIO]
|
||||
* If the minQueueLength is 5: [diskIO]
|
||||
* If the minQueueLength is 6: [diskIO]
|
||||
* If the minQueueLength is 7: [diskIO ]
|
||||
* If the minQueueLength is 8: [diskIO ]
|
||||
*
|
||||
* The default minQueueLength is 0 (no minimum, so [detail box] won't be padded).
|
||||
*
|
||||
* If you want every [detail box] to have the exact same width,
|
||||
* set both minQueueLength and maxQueueLength to the same value.
|
||||
**/
|
||||
@property (assign) NSUInteger minQueueLength;
|
||||
|
||||
/**
|
||||
* The maxQueueLength restricts the number of characters that will be inside the [detail box].
|
||||
* If the maxQueueLength is 0, there is no restriction.
|
||||
*
|
||||
* For example, say a dispatch_queue has a label of "diskIO":
|
||||
*
|
||||
* If the maxQueueLength is 0: [diskIO]
|
||||
* If the maxQueueLength is 4: [disk]
|
||||
* If the maxQueueLength is 5: [diskI]
|
||||
* If the maxQueueLength is 6: [diskIO]
|
||||
* If the maxQueueLength is 7: [diskIO]
|
||||
* If the maxQueueLength is 8: [diskIO]
|
||||
*
|
||||
* The default maxQueueLength is 0 (no maximum, so [detail box] won't be truncated).
|
||||
*
|
||||
* If you want every [detail box] to have the exact same width,
|
||||
* set both minQueueLength and maxQueueLength to the same value.
|
||||
**/
|
||||
@property (assign) NSUInteger maxQueueLength;
|
||||
|
||||
/**
|
||||
* Sometimes queue labels have long names like "com.apple.main-queue",
|
||||
* but you'd prefer something shorter like simply "main".
|
||||
*
|
||||
* This method allows you to set such preferred replacements.
|
||||
* The above example is set by default.
|
||||
*
|
||||
* To remove/undo a previous replacement, invoke this method with nil for the 'shortLabel' parameter.
|
||||
**/
|
||||
- (NSString *)replacementStringForQueueLabel:(NSString *)longLabel;
|
||||
- (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel;
|
||||
|
||||
@end
|
||||
|
||||
/**
|
||||
* Method declarations that make it easier to extend/modify DDDispatchQueueLogFormatter
|
||||
**/
|
||||
@interface DDDispatchQueueLogFormatter (OverridableMethods)
|
||||
|
||||
- (NSString *)stringFromDate:(NSDate *)date;
|
||||
- (NSString *)queueThreadLabelForLogMessage:(DDLogMessage *)logMessage;
|
||||
- (NSString *)formatLogMessage:(DDLogMessage *)logMessage;
|
||||
|
||||
@end
|
||||
|
||||
@@ -1,253 +0,0 @@
|
||||
#import "DDDispatchQueueLogFormatter.h"
|
||||
#import <libkern/OSAtomic.h>
|
||||
|
||||
/**
|
||||
* Welcome to Cocoa Lumberjack!
|
||||
*
|
||||
* The project page has a wealth of documentation if you have any questions.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
||||
**/
|
||||
|
||||
#if ! __has_feature(objc_arc)
|
||||
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
||||
#endif
|
||||
|
||||
|
||||
@implementation DDDispatchQueueLogFormatter
|
||||
{
|
||||
int32_t atomicLoggerCount;
|
||||
NSDateFormatter *threadUnsafeDateFormatter; // Use [self stringFromDate]
|
||||
|
||||
OSSpinLock lock;
|
||||
|
||||
NSUInteger _minQueueLength; // _prefix == Only access via atomic property
|
||||
NSUInteger _maxQueueLength; // _prefix == Only access via atomic property
|
||||
NSMutableDictionary *_replacements; // _prefix == Only access from within spinlock
|
||||
}
|
||||
|
||||
- (id)init
|
||||
{
|
||||
if ((self = [super init]))
|
||||
{
|
||||
dateFormatString = @"yyyy-MM-dd HH:mm:ss:SSS";
|
||||
|
||||
atomicLoggerCount = 0;
|
||||
threadUnsafeDateFormatter = nil;
|
||||
|
||||
_minQueueLength = 0;
|
||||
_maxQueueLength = 0;
|
||||
_replacements = [[NSMutableDictionary alloc] init];
|
||||
|
||||
// Set default replacements:
|
||||
|
||||
_replacements[@"com.apple.main-thread"] = @"main";
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark Configuration
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@synthesize minQueueLength = _minQueueLength;
|
||||
@synthesize maxQueueLength = _maxQueueLength;
|
||||
|
||||
- (NSString *)replacementStringForQueueLabel:(NSString *)longLabel
|
||||
{
|
||||
NSString *result = nil;
|
||||
|
||||
OSSpinLockLock(&lock);
|
||||
{
|
||||
result = _replacements[longLabel];
|
||||
}
|
||||
OSSpinLockUnlock(&lock);
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (void)setReplacementString:(NSString *)shortLabel forQueueLabel:(NSString *)longLabel
|
||||
{
|
||||
OSSpinLockLock(&lock);
|
||||
{
|
||||
if (shortLabel)
|
||||
_replacements[longLabel] = shortLabel;
|
||||
else
|
||||
[_replacements removeObjectForKey:longLabel];
|
||||
}
|
||||
OSSpinLockUnlock(&lock);
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark DDLogFormatter
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
- (NSString *)stringFromDate:(NSDate *)date
|
||||
{
|
||||
int32_t loggerCount = OSAtomicAdd32(0, &atomicLoggerCount);
|
||||
|
||||
if (loggerCount <= 1)
|
||||
{
|
||||
// Single-threaded mode.
|
||||
|
||||
if (threadUnsafeDateFormatter == nil)
|
||||
{
|
||||
threadUnsafeDateFormatter = [[NSDateFormatter alloc] init];
|
||||
[threadUnsafeDateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
|
||||
[threadUnsafeDateFormatter setDateFormat:dateFormatString];
|
||||
}
|
||||
|
||||
[threadUnsafeDateFormatter setCalendar:[[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]];
|
||||
return [threadUnsafeDateFormatter stringFromDate:date];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Multi-threaded mode.
|
||||
// NSDateFormatter is NOT thread-safe.
|
||||
|
||||
NSString *key = @"DispatchQueueLogFormatter_NSDateFormatter";
|
||||
|
||||
NSMutableDictionary *threadDictionary = [[NSThread currentThread] threadDictionary];
|
||||
NSDateFormatter *dateFormatter = threadDictionary[key];
|
||||
|
||||
if (dateFormatter == nil)
|
||||
{
|
||||
dateFormatter = [[NSDateFormatter alloc] init];
|
||||
[dateFormatter setFormatterBehavior:NSDateFormatterBehavior10_4];
|
||||
[dateFormatter setDateFormat:dateFormatString];
|
||||
|
||||
threadDictionary[key] = dateFormatter;
|
||||
}
|
||||
|
||||
[dateFormatter setCalendar:[[NSCalendar alloc] initWithCalendarIdentifier:NSCalendarIdentifierGregorian]];
|
||||
return [dateFormatter stringFromDate:date];
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)queueThreadLabelForLogMessage:(DDLogMessage *)logMessage
|
||||
{
|
||||
// As per the DDLogFormatter contract, this method is always invoked on the same thread/dispatch_queue
|
||||
|
||||
NSUInteger minQueueLength = self.minQueueLength;
|
||||
NSUInteger maxQueueLength = self.maxQueueLength;
|
||||
|
||||
// Get the name of the queue, thread, or machID (whichever we are to use).
|
||||
|
||||
NSString *queueThreadLabel = nil;
|
||||
|
||||
BOOL useQueueLabel = YES;
|
||||
BOOL useThreadName = NO;
|
||||
|
||||
if (logMessage->queueLabel)
|
||||
{
|
||||
// If you manually create a thread, it's dispatch_queue will have one of the thread names below.
|
||||
// Since all such threads have the same name, we'd prefer to use the threadName or the machThreadID.
|
||||
|
||||
char *names[] = { "com.apple.root.low-priority",
|
||||
"com.apple.root.default-priority",
|
||||
"com.apple.root.high-priority",
|
||||
"com.apple.root.low-overcommit-priority",
|
||||
"com.apple.root.default-overcommit-priority",
|
||||
"com.apple.root.high-overcommit-priority" };
|
||||
|
||||
int length = sizeof(names) / sizeof(char *);
|
||||
|
||||
int i;
|
||||
for (i = 0; i < length; i++)
|
||||
{
|
||||
if (strcmp(logMessage->queueLabel, names[i]) == 0)
|
||||
{
|
||||
useQueueLabel = NO;
|
||||
useThreadName = [logMessage->threadName length] > 0;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
useQueueLabel = NO;
|
||||
useThreadName = [logMessage->threadName length] > 0;
|
||||
}
|
||||
|
||||
if (useQueueLabel || useThreadName)
|
||||
{
|
||||
NSString *fullLabel;
|
||||
NSString *abrvLabel;
|
||||
|
||||
if (useQueueLabel)
|
||||
fullLabel = @(logMessage->queueLabel);
|
||||
else
|
||||
fullLabel = logMessage->threadName;
|
||||
|
||||
OSSpinLockLock(&lock);
|
||||
{
|
||||
abrvLabel = _replacements[fullLabel];
|
||||
}
|
||||
OSSpinLockUnlock(&lock);
|
||||
|
||||
if (abrvLabel)
|
||||
queueThreadLabel = abrvLabel;
|
||||
else
|
||||
queueThreadLabel = fullLabel;
|
||||
}
|
||||
else
|
||||
{
|
||||
queueThreadLabel = [NSString stringWithFormat:@"%x", logMessage->machThreadID];
|
||||
}
|
||||
|
||||
// Now use the thread label in the output
|
||||
|
||||
NSUInteger labelLength = [queueThreadLabel length];
|
||||
|
||||
// labelLength > maxQueueLength : truncate
|
||||
// labelLength < minQueueLength : padding
|
||||
// : exact
|
||||
|
||||
if ((maxQueueLength > 0) && (labelLength > maxQueueLength))
|
||||
{
|
||||
// Truncate
|
||||
|
||||
return [queueThreadLabel substringToIndex:maxQueueLength];
|
||||
}
|
||||
else if (labelLength < minQueueLength)
|
||||
{
|
||||
// Padding
|
||||
|
||||
NSUInteger numSpaces = minQueueLength - labelLength;
|
||||
|
||||
char spaces[numSpaces + 1];
|
||||
memset(spaces, ' ', numSpaces);
|
||||
spaces[numSpaces] = '\0';
|
||||
|
||||
return [NSString stringWithFormat:@"%@%s", queueThreadLabel, spaces];
|
||||
}
|
||||
else
|
||||
{
|
||||
// Exact
|
||||
|
||||
return queueThreadLabel;
|
||||
}
|
||||
}
|
||||
|
||||
- (NSString *)formatLogMessage:(DDLogMessage *)logMessage
|
||||
{
|
||||
NSString *timestamp = [self stringFromDate:(logMessage->timestamp)];
|
||||
NSString *queueThreadLabel = [self queueThreadLabelForLogMessage:logMessage];
|
||||
|
||||
return [NSString stringWithFormat:@"%@ [%@] %@", timestamp, queueThreadLabel, logMessage->logMsg];
|
||||
}
|
||||
|
||||
- (void)didAddToLogger:(id <DDLogger>)logger
|
||||
{
|
||||
OSAtomicIncrement32(&atomicLoggerCount);
|
||||
}
|
||||
|
||||
- (void)willRemoveFromLogger:(id <DDLogger>)logger
|
||||
{
|
||||
OSAtomicDecrement32(&atomicLoggerCount);
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,30 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "DDLog.h"
|
||||
|
||||
/**
|
||||
* Welcome to Cocoa Lumberjack!
|
||||
*
|
||||
* The project page has a wealth of documentation if you have any questions.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" page.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
||||
*
|
||||
*
|
||||
* This formatter can be used to chain different formatters together.
|
||||
* The log message will processed in the order of the formatters added.
|
||||
**/
|
||||
|
||||
@interface DDMultiFormatter : NSObject <DDLogFormatter>
|
||||
|
||||
/**
|
||||
* Array of chained formatters
|
||||
*/
|
||||
@property (readonly) NSArray *formatters;
|
||||
|
||||
- (void)addFormatter:(id<DDLogFormatter>)formatter;
|
||||
- (void)removeFormatter:(id<DDLogFormatter>)formatter;
|
||||
- (void)removeAllFormatters;
|
||||
- (BOOL)isFormattingWithFormatter:(id<DDLogFormatter>)formatter;
|
||||
|
||||
@end
|
||||
@@ -1,127 +0,0 @@
|
||||
#import "DDMultiFormatter.h"
|
||||
|
||||
/**
|
||||
* Welcome to Cocoa Lumberjack!
|
||||
*
|
||||
* The project page has a wealth of documentation if you have any questions.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" page.
|
||||
* https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/GettingStarted
|
||||
**/
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
// Compiling for iOS
|
||||
#if __IPHONE_OS_VERSION_MIN_REQUIRED >= 60000 // iOS 6.0 or later
|
||||
#define NEEDS_DISPATCH_RETAIN_RELEASE 0
|
||||
#else // iOS 5.X or earlier
|
||||
#define NEEDS_DISPATCH_RETAIN_RELEASE 1
|
||||
#endif
|
||||
#else
|
||||
// Compiling for Mac OS X
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1080 // Mac OS X 10.8 or later
|
||||
#define NEEDS_DISPATCH_RETAIN_RELEASE 0
|
||||
#else // Mac OS X 10.7 or earlier
|
||||
#define NEEDS_DISPATCH_RETAIN_RELEASE 1
|
||||
#endif
|
||||
#endif
|
||||
|
||||
|
||||
@interface DDMultiFormatter ()
|
||||
|
||||
- (DDLogMessage *)logMessageForLine:(NSString *)line originalMessage:(DDLogMessage *)message;
|
||||
|
||||
@end
|
||||
|
||||
|
||||
@implementation DDMultiFormatter {
|
||||
dispatch_queue_t _queue;
|
||||
NSMutableArray *_formatters;
|
||||
}
|
||||
|
||||
- (id)init {
|
||||
self = [super init];
|
||||
if (self) {
|
||||
#if MAC_OS_X_VERSION_MIN_REQUIRED >= 1070
|
||||
_queue = dispatch_queue_create("cocoa.lumberjack.multiformatter", DISPATCH_QUEUE_CONCURRENT);
|
||||
#else
|
||||
_queue = dispatch_queue_create("cocoa.lumberjack.multiformatter", NULL);
|
||||
#endif
|
||||
_formatters = [NSMutableArray new];
|
||||
}
|
||||
|
||||
return self;
|
||||
}
|
||||
|
||||
#if NEEDS_DISPATCH_RETAIN_RELEASE
|
||||
- (void)dealloc {
|
||||
dispatch_release(_queue);
|
||||
}
|
||||
#endif
|
||||
|
||||
#pragma mark Processing
|
||||
|
||||
- (NSString *)formatLogMessage:(DDLogMessage *)logMessage {
|
||||
__block NSString *line = logMessage->logMsg;
|
||||
|
||||
dispatch_sync(_queue, ^{
|
||||
for (id<DDLogFormatter> formatter in _formatters) {
|
||||
DDLogMessage *message = [self logMessageForLine:line originalMessage:logMessage];
|
||||
line = [formatter formatLogMessage:message];
|
||||
|
||||
if (!line) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return line;
|
||||
}
|
||||
|
||||
- (DDLogMessage *)logMessageForLine:(NSString *)line originalMessage:(DDLogMessage *)message {
|
||||
DDLogMessage *newMessage = [message copy];
|
||||
newMessage->logMsg = line;
|
||||
return newMessage;
|
||||
}
|
||||
|
||||
#pragma mark Formatters
|
||||
|
||||
- (NSArray *)formatters {
|
||||
__block NSArray *formatters;
|
||||
|
||||
dispatch_sync(_queue, ^{
|
||||
formatters = [_formatters copy];
|
||||
});
|
||||
|
||||
return formatters;
|
||||
}
|
||||
|
||||
- (void)addFormatter:(id<DDLogFormatter>)formatter {
|
||||
dispatch_barrier_async(_queue, ^{
|
||||
[_formatters addObject:formatter];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)removeFormatter:(id<DDLogFormatter>)formatter {
|
||||
dispatch_barrier_async(_queue, ^{
|
||||
[_formatters removeObject:formatter];
|
||||
});
|
||||
}
|
||||
|
||||
- (void)removeAllFormatters {
|
||||
dispatch_barrier_async(_queue, ^{
|
||||
[_formatters removeAllObjects];
|
||||
});
|
||||
}
|
||||
|
||||
- (BOOL)isFormattingWithFormatter:(id<DDLogFormatter>)formatter {
|
||||
__block BOOL hasFormatter;
|
||||
|
||||
dispatch_sync(_queue, ^{
|
||||
hasFormatter = [_formatters containsObject:formatter];
|
||||
});
|
||||
|
||||
return hasFormatter;
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,7 +0,0 @@
|
||||
This folder contains some sample formatters that may be helpful.
|
||||
|
||||
Feel free to change them, extend them, or use them as the basis for your own custom formatter(s).
|
||||
|
||||
More information about creating your own custom formatters can be found on the wiki:
|
||||
https://github.com/CocoaLumberjack/CocoaLumberjack/wiki/CustomFormatters
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#if !(TARGET_IPHONE_SIMULATOR)
|
||||
@import libxml;
|
||||
#else
|
||||
@import libxmlSimu;
|
||||
#endif
|
||||
|
||||
@interface NSString (DDXML)
|
||||
|
||||
/**
|
||||
* xmlChar - A basic replacement for char, a byte in a UTF-8 encoded string.
|
||||
**/
|
||||
- (const xmlChar *)xmlChar;
|
||||
|
||||
- (NSString *)stringByTrimming;
|
||||
|
||||
@end
|
||||
@@ -1,31 +0,0 @@
|
||||
#import "NSString+DDXML.h"
|
||||
|
||||
#if ! __has_feature(objc_arc)
|
||||
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
||||
#endif
|
||||
|
||||
@implementation NSString (DDXML)
|
||||
|
||||
- (const xmlChar *)xmlChar
|
||||
{
|
||||
return (const xmlChar *)[self UTF8String];
|
||||
}
|
||||
|
||||
#ifdef GNUSTEP
|
||||
- (NSString *)stringByTrimming
|
||||
{
|
||||
return [self stringByTrimmingSpaces];
|
||||
}
|
||||
#else
|
||||
- (NSString *)stringByTrimming
|
||||
{
|
||||
NSMutableString *mStr = [self mutableCopy];
|
||||
CFStringTrimWhitespace((__bridge CFMutableStringRef)mStr);
|
||||
|
||||
NSString *result = [mStr copy];
|
||||
|
||||
return result;
|
||||
}
|
||||
#endif
|
||||
|
||||
@end
|
||||
@@ -1,196 +0,0 @@
|
||||
/**
|
||||
* Welcome to KissXML.
|
||||
*
|
||||
* The project page has documentation if you have questions.
|
||||
* https://github.com/robbiehanson/KissXML
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/robbiehanson/KissXML/wiki/GettingStarted
|
||||
*
|
||||
* KissXML provides a drop-in replacement for Apple's NSXML class cluster.
|
||||
* The goal is to get the exact same behavior as the NSXML classes.
|
||||
*
|
||||
* For API Reference, see Apple's excellent documentation,
|
||||
* either via Xcode's Mac OS X documentation, or via the web:
|
||||
*
|
||||
* https://github.com/robbiehanson/KissXML/wiki/Reference
|
||||
**/
|
||||
|
||||
#import "DDXMLNode.h"
|
||||
#import "DDXMLElement.h"
|
||||
#import "DDXMLDocument.h"
|
||||
|
||||
|
||||
|
||||
#if TARGET_OS_IPHONE
|
||||
|
||||
// Since KissXML is a drop in replacement for NSXML,
|
||||
// it may be desireable (when writing cross-platform code to be used on both Mac OS X and iOS)
|
||||
// to use the NSXML prefixes instead of the DDXML prefix.
|
||||
//
|
||||
// This way, on Mac OS X it uses NSXML, and on iOS it uses KissXML.
|
||||
|
||||
#ifndef NSXMLNode
|
||||
#define NSXMLNode DDXMLNode
|
||||
#endif
|
||||
#ifndef NSXMLElement
|
||||
#define NSXMLElement DDXMLElement
|
||||
#endif
|
||||
#ifndef NSXMLDocument
|
||||
#define NSXMLDocument DDXMLDocument
|
||||
#endif
|
||||
|
||||
#ifndef NSXMLInvalidKind
|
||||
#define NSXMLInvalidKind DDXMLInvalidKind
|
||||
#endif
|
||||
#ifndef NSXMLDocumentKind
|
||||
#define NSXMLDocumentKind DDXMLDocumentKind
|
||||
#endif
|
||||
#ifndef NSXMLElementKind
|
||||
#define NSXMLElementKind DDXMLElementKind
|
||||
#endif
|
||||
#ifndef NSXMLAttributeKind
|
||||
#define NSXMLAttributeKind DDXMLAttributeKind
|
||||
#endif
|
||||
#ifndef NSXMLNamespaceKind
|
||||
#define NSXMLNamespaceKind DDXMLNamespaceKind
|
||||
#endif
|
||||
#ifndef NSXMLProcessingInstructionKind
|
||||
#define NSXMLProcessingInstructionKind DDXMLProcessingInstructionKind
|
||||
#endif
|
||||
#ifndef NSXMLCommentKind
|
||||
#define NSXMLCommentKind DDXMLCommentKind
|
||||
#endif
|
||||
#ifndef NSXMLTextKind
|
||||
#define NSXMLTextKind DDXMLTextKind
|
||||
#endif
|
||||
#ifndef NSXMLDTDKind
|
||||
#define NSXMLDTDKind DDXMLDTDKind
|
||||
#endif
|
||||
#ifndef NSXMLEntityDeclarationKind
|
||||
#define NSXMLEntityDeclarationKind DDXMLEntityDeclarationKind
|
||||
#endif
|
||||
#ifndef NSXMLAttributeDeclarationKind
|
||||
#define NSXMLAttributeDeclarationKind DDXMLAttributeDeclarationKind
|
||||
#endif
|
||||
#ifndef NSXMLElementDeclarationKind
|
||||
#define NSXMLElementDeclarationKind DDXMLElementDeclarationKind
|
||||
#endif
|
||||
#ifndef NSXMLNotationDeclarationKind
|
||||
#define NSXMLNotationDeclarationKind DDXMLNotationDeclarationKind
|
||||
#endif
|
||||
|
||||
#ifndef NSXMLNodeOptionsNone
|
||||
#define NSXMLNodeOptionsNone DDXMLNodeOptionsNone
|
||||
#endif
|
||||
#ifndef NSXMLNodeExpandEmptyElement
|
||||
#define NSXMLNodeExpandEmptyElement DDXMLNodeExpandEmptyElement
|
||||
#endif
|
||||
#ifndef NSXMLNodeCompactEmptyElement
|
||||
#define NSXMLNodeCompactEmptyElement DDXMLNodeCompactEmptyElement
|
||||
#endif
|
||||
#ifndef NSXMLNodePrettyPrint
|
||||
#define NSXMLNodePrettyPrint DDXMLNodePrettyPrint
|
||||
#endif
|
||||
|
||||
#endif // #if TARGET_OS_IPHONE
|
||||
|
||||
|
||||
|
||||
// KissXML has rather straight-forward memory management:
|
||||
// https://github.com/robbiehanson/KissXML/wiki/MemoryManagementThreadSafety
|
||||
//
|
||||
// There are 3 important concepts to keep in mind when working with KissXML:
|
||||
//
|
||||
//
|
||||
// 1.) KissXML provides a light-weight wrapper around libxml.
|
||||
//
|
||||
// The parsing, creation, storage, etc of the xml tree is all done via libxml.
|
||||
// This is a fast low-level C library that's been around for ages, and comes pre-installed on Mac OS X and iOS.
|
||||
// KissXML provides an easy-to-use Objective-C library atop libxml.
|
||||
// So a DDXMLNode, DDXMLElement, or DDXMLDocument are simply objective-c objects
|
||||
// with pointers to the underlying libxml C structure.
|
||||
// Then only time you need to be aware of any of this is when it comes to equality.
|
||||
// In order to maximize speed and provide read-access thread-safety,
|
||||
// the library may create multiple DDXML wrapper objects that point to the same underlying xml node.
|
||||
// So don't assume you can test for equality with "==".
|
||||
// Instead use the isEqual method (as you should generally do with objects anyway).
|
||||
//
|
||||
//
|
||||
// 2.) XML is implicitly a tree heirarchy, and the XML API's are designed to allow traversal up & down the tree.
|
||||
//
|
||||
// The tree heirarchy and API contract have an implicit impact concerning memory management.
|
||||
//
|
||||
// <starbucks>
|
||||
// <latte/>
|
||||
// </starbucks>
|
||||
//
|
||||
// Imagine you have a DDXMLNode corresponding to the starbucks node,
|
||||
// and you have a DDXMLNode corresponding to the latte node.
|
||||
// Now imagine you release the starbucks node, but you retain a reference to the latte node.
|
||||
// What happens?
|
||||
// Well the latte node is a part of the xml tree heirarchy.
|
||||
// So if the latte node is still around, the xml tree heirarchy must stick around as well.
|
||||
// So even though the DDXMLNode corresponding to the starbucks node may get deallocated,
|
||||
// the underlying xml tree structure won't be freed until the latte node gets dealloacated.
|
||||
//
|
||||
// In general, this means that KissXML remains thread-safe when reading and processing a tree.
|
||||
// If you traverse a tree and fork off asynchronous tasks to process subnodes,
|
||||
// the tree will remain properly in place until all your asynchronous tasks have completed.
|
||||
// In other words, it just works.
|
||||
//
|
||||
// However, if you parse a huge document into memory, and retain a single node from the giant xml tree...
|
||||
// Well you should see the problem this creates.
|
||||
// Instead, in this situation, copy or detach the node if you want to keep it around.
|
||||
// Or just extract the info you need from it.
|
||||
//
|
||||
//
|
||||
// 3.) KissXML is read-access thread-safe, but write-access thread-unsafe (designed for speed).
|
||||
//
|
||||
// <starbucks>
|
||||
// <latte/>
|
||||
// </starbucks>
|
||||
//
|
||||
// Imagine you have a DDXMLNode corresponding to the starbucks node,
|
||||
// and you have a DDXMLNode corresponding to the latte node.
|
||||
// What happens if you invoke [starbucks removeChildAtIndex:0]?
|
||||
// Well the undelying xml tree will remove the latte node, and release the associated memory.
|
||||
// And what if you still have a reference to the DDXMLNode that corresponds to the latte node?
|
||||
// Well the short answer is that you shouldn't use it. At all.
|
||||
// This is pretty obvious when you think about it from the context of this simple example.
|
||||
// But in the real world, you might have multiple threads running in parallel,
|
||||
// and you might accidently modify a node while another thread is processing it.
|
||||
//
|
||||
// To completely fix this problem, and provide write-access thread-safety, would require extensive overhead.
|
||||
// This overhead is completely unwanted in the majority of cases.
|
||||
// Most XML usage patterns are heavily read-only.
|
||||
// And in the case of xml creation or modification, it is generally done on the same thread.
|
||||
// Thus the KissXML library is write-access thread-unsafe, but provides speedier performance.
|
||||
//
|
||||
// However, when such a bug does creep up, it produces horrible side-effects.
|
||||
// Essentially the pointer to the underlying xml structure becomes a dangling pointer,
|
||||
// which means that accessing the dangling pointer might give you the correct results, or completely random results.
|
||||
// And attempting to make modifications to non-existant xml nodes via the dangling pointer might do nothing,
|
||||
// or completely corrupt your heap and cause un-explainable crashes in random parts of your library.
|
||||
// Heap corruption is one of the worst problems to track down.
|
||||
// So to help out, the library provides a debugging macro to track down these problems.
|
||||
// That is, if you invalidate the write-access thread-unsafe rule,
|
||||
// this macro will tell you when you're trying to access a now-dangling pointer.
|
||||
//
|
||||
// How does it work?
|
||||
// Well everytime a DDXML wrapper object is created atop a libxml structure,
|
||||
// it marks the linkage in a table.
|
||||
// And everytime a libxml structure is freed, it destorys all corresponding linkages in the table.
|
||||
// So everytime a DDXML wrapper objects is about to dereference it's pointer,
|
||||
// it first ensures the linkage still exists in the table.
|
||||
//
|
||||
// Set to 1 to enable
|
||||
// Set to 0 to disable (this is the default)
|
||||
//
|
||||
// The debugging macro adds a significant amount of overhead, and should NOT be enabled on production builds.
|
||||
|
||||
#if DEBUG
|
||||
#define DDXML_DEBUG_MEMORY_ISSUES 0
|
||||
#else
|
||||
#define DDXML_DEBUG_MEMORY_ISSUES 0 // Don't change me!
|
||||
#endif
|
||||
@@ -1,84 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "DDXMLElement.h"
|
||||
#import "DDXMLNode.h"
|
||||
|
||||
/**
|
||||
* Welcome to KissXML.
|
||||
*
|
||||
* The project page has documentation if you have questions.
|
||||
* https://github.com/robbiehanson/KissXML
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/robbiehanson/KissXML/wiki/GettingStarted
|
||||
*
|
||||
* KissXML provides a drop-in replacement for Apple's NSXML class cluster.
|
||||
* The goal is to get the exact same behavior as the NSXML classes.
|
||||
*
|
||||
* For API Reference, see Apple's excellent documentation,
|
||||
* either via Xcode's Mac OS X documentation, or via the web:
|
||||
*
|
||||
* https://github.com/robbiehanson/KissXML/wiki/Reference
|
||||
**/
|
||||
|
||||
enum {
|
||||
DDXMLDocumentXMLKind = 0,
|
||||
DDXMLDocumentXHTMLKind,
|
||||
DDXMLDocumentHTMLKind,
|
||||
DDXMLDocumentTextKind
|
||||
};
|
||||
typedef NSUInteger DDXMLDocumentContentKind;
|
||||
|
||||
@interface DDXMLDocument : DDXMLNode
|
||||
{
|
||||
}
|
||||
|
||||
- (id)initWithXMLString:(NSString *)string options:(NSUInteger)mask error:(NSError **)error;
|
||||
//- (id)initWithContentsOfURL:(NSURL *)url options:(NSUInteger)mask error:(NSError **)error;
|
||||
- (id)initWithData:(NSData *)data options:(NSUInteger)mask error:(NSError **)error;
|
||||
//- (id)initWithRootElement:(DDXMLElement *)element;
|
||||
|
||||
//+ (Class)replacementClassForClass:(Class)cls;
|
||||
|
||||
//- (void)setCharacterEncoding:(NSString *)encoding; //primitive
|
||||
//- (NSString *)characterEncoding; //primitive
|
||||
|
||||
//- (void)setVersion:(NSString *)version;
|
||||
//- (NSString *)version;
|
||||
|
||||
//- (void)setStandalone:(BOOL)standalone;
|
||||
//- (BOOL)isStandalone;
|
||||
|
||||
//- (void)setDocumentContentKind:(DDXMLDocumentContentKind)kind;
|
||||
//- (DDXMLDocumentContentKind)documentContentKind;
|
||||
|
||||
//- (void)setMIMEType:(NSString *)MIMEType;
|
||||
//- (NSString *)MIMEType;
|
||||
|
||||
//- (void)setDTD:(DDXMLDTD *)documentTypeDeclaration;
|
||||
//- (DDXMLDTD *)DTD;
|
||||
|
||||
//- (void)setRootElement:(DDXMLNode *)root;
|
||||
- (DDXMLElement *)rootElement;
|
||||
|
||||
//- (void)insertChild:(DDXMLNode *)child atIndex:(NSUInteger)index;
|
||||
|
||||
//- (void)insertChildren:(NSArray *)children atIndex:(NSUInteger)index;
|
||||
|
||||
//- (void)removeChildAtIndex:(NSUInteger)index;
|
||||
|
||||
//- (void)setChildren:(NSArray *)children;
|
||||
|
||||
//- (void)addChild:(DDXMLNode *)child;
|
||||
|
||||
//- (void)replaceChildAtIndex:(NSUInteger)index withNode:(DDXMLNode *)node;
|
||||
|
||||
- (NSData *)XMLData;
|
||||
- (NSData *)XMLDataWithOptions:(NSUInteger)options;
|
||||
|
||||
//- (id)objectByApplyingXSLT:(NSData *)xslt arguments:(NSDictionary *)arguments error:(NSError **)error;
|
||||
//- (id)objectByApplyingXSLTString:(NSString *)xslt arguments:(NSDictionary *)arguments error:(NSError **)error;
|
||||
//- (id)objectByApplyingXSLTAtURL:(NSURL *)xsltURL arguments:(NSDictionary *)argument error:(NSError **)error;
|
||||
|
||||
//- (BOOL)validateAndReturnError:(NSError **)error;
|
||||
|
||||
@end
|
||||
@@ -1,140 +0,0 @@
|
||||
#import "DDXMLPrivate.h"
|
||||
#import "NSString+DDXML.h"
|
||||
|
||||
#if ! __has_feature(objc_arc)
|
||||
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Welcome to KissXML.
|
||||
*
|
||||
* The project page has documentation if you have questions.
|
||||
* https://github.com/robbiehanson/KissXML
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/robbiehanson/KissXML/wiki/GettingStarted
|
||||
*
|
||||
* KissXML provides a drop-in replacement for Apple's NSXML class cluster.
|
||||
* The goal is to get the exact same behavior as the NSXML classes.
|
||||
*
|
||||
* For API Reference, see Apple's excellent documentation,
|
||||
* either via Xcode's Mac OS X documentation, or via the web:
|
||||
*
|
||||
* https://github.com/robbiehanson/KissXML/wiki/Reference
|
||||
**/
|
||||
|
||||
@implementation DDXMLDocument
|
||||
|
||||
/**
|
||||
* Returns a DDXML wrapper object for the given primitive node.
|
||||
* The given node MUST be non-NULL and of the proper type.
|
||||
**/
|
||||
+ (id)nodeWithDocPrimitive:(xmlDocPtr)doc owner:(DDXMLNode *)owner
|
||||
{
|
||||
return [[DDXMLDocument alloc] initWithDocPrimitive:doc owner:owner];
|
||||
}
|
||||
|
||||
- (id)initWithDocPrimitive:(xmlDocPtr)doc owner:(DDXMLNode *)inOwner
|
||||
{
|
||||
self = [super initWithPrimitive:(xmlKindPtr)doc owner:inOwner];
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (id)nodeWithPrimitive:(xmlKindPtr)kindPtr owner:(DDXMLNode *)owner
|
||||
{
|
||||
// Promote initializers which use proper parameter types to enable compiler to catch more mistakes
|
||||
NSAssert(NO, @"Use nodeWithDocPrimitive:owner:");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (id)initWithPrimitive:(xmlKindPtr)kindPtr owner:(DDXMLNode *)inOwner
|
||||
{
|
||||
// Promote initializers which use proper parameter types to enable compiler to catch more mistakes.
|
||||
NSAssert(NO, @"Use initWithDocPrimitive:owner:");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes and returns a DDXMLDocument object created from an NSData object.
|
||||
*
|
||||
* Returns an initialized DDXMLDocument object, or nil if initialization fails
|
||||
* because of parsing errors or other reasons.
|
||||
**/
|
||||
- (id)initWithXMLString:(NSString *)string options:(NSUInteger)mask error:(NSError **)error
|
||||
{
|
||||
return [self initWithData:[string dataUsingEncoding:NSUTF8StringEncoding]
|
||||
options:mask
|
||||
error:error];
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes and returns a DDXMLDocument object created from an NSData object.
|
||||
*
|
||||
* Returns an initialized DDXMLDocument object, or nil if initialization fails
|
||||
* because of parsing errors or other reasons.
|
||||
**/
|
||||
- (id)initWithData:(NSData *)data options:(NSUInteger)mask error:(NSError **)error
|
||||
{
|
||||
if (data == nil || [data length] == 0)
|
||||
{
|
||||
if (error) *error = [NSError errorWithDomain:@"DDXMLErrorDomain" code:0 userInfo:nil];
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
// Even though xmlKeepBlanksDefault(0) is called in DDXMLNode's initialize method,
|
||||
// it has been documented that this call seems to get reset on the iPhone:
|
||||
// http://code.google.com/p/kissxml/issues/detail?id=8
|
||||
//
|
||||
// Therefore, we call it again here just to be safe.
|
||||
xmlKeepBlanksDefault(0);
|
||||
|
||||
xmlDocPtr doc = xmlParseMemory([data bytes], (int)[data length]);
|
||||
if (doc == NULL)
|
||||
{
|
||||
if (error) *error = [NSError errorWithDomain:@"DDXMLErrorDomain" code:1 userInfo:nil];
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
return [self initWithDocPrimitive:doc owner:nil];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the root element of the receiver.
|
||||
**/
|
||||
- (DDXMLElement *)rootElement
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
xmlDocPtr doc = (xmlDocPtr)genericPtr;
|
||||
|
||||
// doc->children is a list containing possibly comments, DTDs, etc...
|
||||
|
||||
xmlNodePtr rootNode = xmlDocGetRootElement(doc);
|
||||
|
||||
if (rootNode != NULL)
|
||||
return [DDXMLElement nodeWithElementPrimitive:rootNode owner:self];
|
||||
else
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (NSData *)XMLData
|
||||
{
|
||||
// Zombie test occurs in XMLString
|
||||
|
||||
return [[self XMLString] dataUsingEncoding:NSUTF8StringEncoding];
|
||||
}
|
||||
|
||||
- (NSData *)XMLDataWithOptions:(NSUInteger)options
|
||||
{
|
||||
// Zombie test occurs in XMLString
|
||||
|
||||
return [[self XMLStringWithOptions:options] dataUsingEncoding:NSUTF8StringEncoding];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,66 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
#import "DDXMLNode.h"
|
||||
|
||||
/**
|
||||
* Welcome to KissXML.
|
||||
*
|
||||
* The project page has documentation if you have questions.
|
||||
* https://github.com/robbiehanson/KissXML
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/robbiehanson/KissXML/wiki/GettingStarted
|
||||
*
|
||||
* KissXML provides a drop-in replacement for Apple's NSXML class cluster.
|
||||
* The goal is to get the exact same behavior as the NSXML classes.
|
||||
*
|
||||
* For API Reference, see Apple's excellent documentation,
|
||||
* either via Xcode's Mac OS X documentation, or via the web:
|
||||
*
|
||||
* https://github.com/robbiehanson/KissXML/wiki/Reference
|
||||
**/
|
||||
|
||||
@interface DDXMLElement : DDXMLNode
|
||||
{
|
||||
}
|
||||
|
||||
- (id)initWithName:(NSString *)name;
|
||||
- (id)initWithName:(NSString *)name URI:(NSString *)URI;
|
||||
- (id)initWithName:(NSString *)name stringValue:(NSString *)string;
|
||||
- (id)initWithXMLString:(NSString *)string error:(NSError **)error;
|
||||
|
||||
#pragma mark --- Elements by name ---
|
||||
|
||||
- (NSArray *)elementsForName:(NSString *)name;
|
||||
- (NSArray *)elementsForLocalName:(NSString *)localName URI:(NSString *)URI;
|
||||
|
||||
#pragma mark --- Attributes ---
|
||||
|
||||
- (void)addAttribute:(DDXMLNode *)attribute;
|
||||
- (void)removeAttributeForName:(NSString *)name;
|
||||
- (void)setAttributes:(NSArray *)attributes;
|
||||
//- (void)setAttributesAsDictionary:(NSDictionary *)attributes;
|
||||
- (NSArray *)attributes;
|
||||
- (DDXMLNode *)attributeForName:(NSString *)name;
|
||||
//- (DDXMLNode *)attributeForLocalName:(NSString *)localName URI:(NSString *)URI;
|
||||
|
||||
#pragma mark --- Namespaces ---
|
||||
|
||||
- (void)addNamespace:(DDXMLNode *)aNamespace;
|
||||
- (void)removeNamespaceForPrefix:(NSString *)name;
|
||||
- (void)setNamespaces:(NSArray *)namespaces;
|
||||
- (NSArray *)namespaces;
|
||||
- (DDXMLNode *)namespaceForPrefix:(NSString *)prefix;
|
||||
- (DDXMLNode *)resolveNamespaceForName:(NSString *)name;
|
||||
- (NSString *)resolvePrefixForNamespaceURI:(NSString *)namespaceURI;
|
||||
|
||||
#pragma mark --- Children ---
|
||||
|
||||
- (void)insertChild:(DDXMLNode *)child atIndex:(NSUInteger)index;
|
||||
//- (void)insertChildren:(NSArray *)children atIndex:(NSUInteger)index;
|
||||
- (void)removeChildAtIndex:(NSUInteger)index;
|
||||
- (void)setChildren:(NSArray *)children;
|
||||
- (void)addChild:(DDXMLNode *)child;
|
||||
//- (void)replaceChildAtIndex:(NSUInteger)index withNode:(DDXMLNode *)node;
|
||||
//- (void)normalizeAdjacentTextNodesPreservingCDATA:(BOOL)preserve;
|
||||
|
||||
@end
|
||||
@@ -1,801 +0,0 @@
|
||||
#import "DDXMLPrivate.h"
|
||||
#import "NSString+DDXML.h"
|
||||
|
||||
#if ! __has_feature(objc_arc)
|
||||
#warning This file must be compiled with ARC. Use -fobjc-arc flag (or convert project to ARC).
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Welcome to KissXML.
|
||||
*
|
||||
* The project page has documentation if you have questions.
|
||||
* https://github.com/robbiehanson/KissXML
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/robbiehanson/KissXML/wiki/GettingStarted
|
||||
*
|
||||
* KissXML provides a drop-in replacement for Apple's NSXML class cluster.
|
||||
* The goal is to get the exact same behavior as the NSXML classes.
|
||||
*
|
||||
* For API Reference, see Apple's excellent documentation,
|
||||
* either via Xcode's Mac OS X documentation, or via the web:
|
||||
*
|
||||
* https://github.com/robbiehanson/KissXML/wiki/Reference
|
||||
**/
|
||||
|
||||
@implementation DDXMLElement
|
||||
|
||||
/**
|
||||
* Returns a DDXML wrapper object for the given primitive node.
|
||||
* The given node MUST be non-NULL and of the proper type.
|
||||
**/
|
||||
+ (id)nodeWithElementPrimitive:(xmlNodePtr)node owner:(DDXMLNode *)owner
|
||||
{
|
||||
return [[DDXMLElement alloc] initWithElementPrimitive:node owner:owner];
|
||||
}
|
||||
|
||||
- (id)initWithElementPrimitive:(xmlNodePtr)node owner:(DDXMLNode *)inOwner
|
||||
{
|
||||
self = [super initWithPrimitive:(xmlKindPtr)node owner:inOwner];
|
||||
return self;
|
||||
}
|
||||
|
||||
+ (id)nodeWithPrimitive:(xmlKindPtr)kindPtr owner:(DDXMLNode *)owner
|
||||
{
|
||||
// Promote initializers which use proper parameter types to enable compiler to catch more mistakes
|
||||
NSAssert(NO, @"Use nodeWithElementPrimitive:owner:");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (id)initWithPrimitive:(xmlKindPtr)kindPtr owner:(DDXMLNode *)inOwner
|
||||
{
|
||||
// Promote initializers which use proper parameter types to enable compiler to catch more mistakes.
|
||||
NSAssert(NO, @"Use initWithElementPrimitive:owner:");
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (id)initWithName:(NSString *)name
|
||||
{
|
||||
// Note: Make every guarantee that genericPtr is not null
|
||||
|
||||
xmlNodePtr node = xmlNewNode(NULL, [name xmlChar]);
|
||||
if (node == NULL)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
return [self initWithElementPrimitive:node owner:nil];
|
||||
}
|
||||
|
||||
- (id)initWithName:(NSString *)name URI:(NSString *)URI
|
||||
{
|
||||
// Note: Make every guarantee that genericPtr is not null
|
||||
|
||||
xmlNodePtr node = xmlNewNode(NULL, [name xmlChar]);
|
||||
if (node == NULL)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
DDXMLElement *result = [self initWithElementPrimitive:node owner:nil];
|
||||
[result setURI:URI];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (id)initWithName:(NSString *)name stringValue:(NSString *)string
|
||||
{
|
||||
// Note: Make every guarantee that genericPtr is not null
|
||||
|
||||
xmlNodePtr node = xmlNewNode(NULL, [name xmlChar]);
|
||||
if (node == NULL)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
DDXMLElement *result = [self initWithElementPrimitive:node owner:nil];
|
||||
[result setStringValue:string];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (id)initWithXMLString:(NSString *)string error:(NSError **)error
|
||||
{
|
||||
DDXMLDocument *doc = [[DDXMLDocument alloc] initWithXMLString:string options:0 error:error];
|
||||
if (doc == nil)
|
||||
{
|
||||
return nil;
|
||||
}
|
||||
|
||||
DDXMLElement *result = [doc rootElement];
|
||||
[result detach];
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark Elements by name
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Helper method elementsForName and elementsForLocalName:URI: so work isn't duplicated.
|
||||
* The name parameter is required, all others are optional.
|
||||
**/
|
||||
- (NSArray *)_elementsForName:(NSString *)name
|
||||
localName:(NSString *)localName
|
||||
prefix:(NSString *)prefix
|
||||
uri:(NSString *)uri
|
||||
{
|
||||
// This is a private/internal method
|
||||
|
||||
// Rule : !uri => match: name
|
||||
// Rule : uri && hasPrefix => match: name || (localName && uri)
|
||||
// Rule : uri && !hasPefix => match: name && uri
|
||||
|
||||
xmlNodePtr node = (xmlNodePtr)genericPtr;
|
||||
|
||||
NSMutableArray *result = [NSMutableArray array];
|
||||
|
||||
BOOL hasPrefix = [prefix length] > 0;
|
||||
|
||||
const xmlChar *xmlName = [name xmlChar];
|
||||
const xmlChar *xmlLocalName = [localName xmlChar];
|
||||
const xmlChar *xmlUri = [uri xmlChar];
|
||||
|
||||
xmlNodePtr child = node->children;
|
||||
while (child)
|
||||
{
|
||||
if (IsXmlNodePtr(child))
|
||||
{
|
||||
BOOL match = NO;
|
||||
|
||||
if (uri == nil)
|
||||
{
|
||||
match = xmlStrEqual(child->name, xmlName);
|
||||
}
|
||||
else
|
||||
{
|
||||
BOOL nameMatch = xmlStrEqual(child->name, xmlName);
|
||||
BOOL localNameMatch = xmlStrEqual(child->name, xmlLocalName);
|
||||
|
||||
BOOL uriMatch = NO;
|
||||
if (child->ns)
|
||||
{
|
||||
uriMatch = xmlStrEqual(child->ns->href, xmlUri);
|
||||
}
|
||||
|
||||
if (hasPrefix)
|
||||
match = nameMatch || (localNameMatch && uriMatch);
|
||||
else
|
||||
match = nameMatch && uriMatch;
|
||||
}
|
||||
|
||||
if (match)
|
||||
{
|
||||
[result addObject:[DDXMLElement nodeWithElementPrimitive:child owner:self]];
|
||||
}
|
||||
}
|
||||
|
||||
child = child->next;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the child element nodes (as DDXMLElement objects) of the receiver that have a specified name.
|
||||
*
|
||||
* If name is a qualified name, then this method invokes elementsForLocalName:URI: with the URI parameter set to
|
||||
* the URI associated with the prefix. Otherwise comparison is based on string equality of the qualified or
|
||||
* non-qualified name.
|
||||
**/
|
||||
- (NSArray *)elementsForName:(NSString *)name
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
if (name == nil) return [NSArray array];
|
||||
|
||||
// We need to check to see if name has a prefix.
|
||||
// If it does have a prefix, we need to figure out what the corresponding URI is for that prefix,
|
||||
// and then search for any elements that have the same name (including prefix) OR have the same URI.
|
||||
// Otherwise we loop through the children as usual and do a string compare on the name
|
||||
|
||||
NSString *prefix;
|
||||
NSString *localName;
|
||||
|
||||
[DDXMLNode getPrefix:&prefix localName:&localName forName:name];
|
||||
|
||||
if ([prefix length] > 0)
|
||||
{
|
||||
xmlNodePtr node = (xmlNodePtr)genericPtr;
|
||||
|
||||
// Note: We use xmlSearchNs instead of resolveNamespaceForName: because
|
||||
// we want to avoid creating wrapper objects when possible.
|
||||
|
||||
xmlNsPtr ns = xmlSearchNs(node->doc, node, [prefix xmlChar]);
|
||||
if (ns)
|
||||
{
|
||||
NSString *uri = [NSString stringWithUTF8String:((const char *)ns->href)];
|
||||
return [self _elementsForName:name localName:localName prefix:prefix uri:uri];
|
||||
}
|
||||
}
|
||||
|
||||
return [self _elementsForName:name localName:localName prefix:prefix uri:nil];
|
||||
}
|
||||
|
||||
- (NSArray *)elementsForLocalName:(NSString *)localName URI:(NSString *)uri
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
if (localName == nil) return [NSArray array];
|
||||
|
||||
// We need to figure out what the prefix is for this URI.
|
||||
// Then we search for elements that are named prefix:localName OR (named localName AND have the given URI).
|
||||
|
||||
NSString *prefix = [self _recursiveResolvePrefixForURI:uri atNode:(xmlNodePtr)genericPtr];
|
||||
if (prefix)
|
||||
{
|
||||
NSString *name = [NSString stringWithFormat:@"%@:%@", prefix, localName];
|
||||
|
||||
return [self _elementsForName:name localName:localName prefix:prefix uri:uri];
|
||||
}
|
||||
else
|
||||
{
|
||||
NSString *prefix;
|
||||
NSString *realLocalName;
|
||||
|
||||
[DDXMLNode getPrefix:&prefix localName:&realLocalName forName:localName];
|
||||
|
||||
return [self _elementsForName:localName localName:realLocalName prefix:prefix uri:uri];
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark Attributes
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
- (BOOL)_hasAttributeWithName:(NSString *)name
|
||||
{
|
||||
// This is a private/internal method
|
||||
|
||||
xmlAttrPtr attr = ((xmlNodePtr)genericPtr)->properties;
|
||||
if (attr)
|
||||
{
|
||||
const xmlChar *xmlName = [name xmlChar];
|
||||
do
|
||||
{
|
||||
if (xmlStrEqual(attr->name, xmlName))
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
attr = attr->next;
|
||||
|
||||
} while (attr);
|
||||
}
|
||||
|
||||
return NO;
|
||||
}
|
||||
|
||||
- (void)_removeAttributeForName:(NSString *)name
|
||||
{
|
||||
// This is a private/internal method
|
||||
|
||||
xmlAttrPtr attr = ((xmlNodePtr)genericPtr)->properties;
|
||||
if (attr)
|
||||
{
|
||||
const xmlChar *xmlName = [name xmlChar];
|
||||
do
|
||||
{
|
||||
if (xmlStrEqual(attr->name, xmlName))
|
||||
{
|
||||
[DDXMLNode removeAttribute:attr];
|
||||
return;
|
||||
}
|
||||
attr = attr->next;
|
||||
|
||||
} while(attr);
|
||||
}
|
||||
}
|
||||
|
||||
- (void)addAttribute:(DDXMLNode *)attribute
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
// NSXML version uses this same assertion
|
||||
DDXMLAssert([attribute _hasParent] == NO, @"Cannot add an attribute with a parent; detach or copy first");
|
||||
DDXMLAssert(IsXmlAttrPtr(attribute->genericPtr), @"Not an attribute");
|
||||
|
||||
[self _removeAttributeForName:[attribute name]];
|
||||
|
||||
// xmlNodePtr xmlAddChild(xmlNodePtr parent, xmlNodePtr cur)
|
||||
// Add a new node to @parent, at the end of the child (or property) list merging
|
||||
// adjacent TEXT nodes (in which case @cur is freed). If the new node is ATTRIBUTE, it is added
|
||||
// into properties instead of children. If there is an attribute with equal name, it is first destroyed.
|
||||
|
||||
xmlAddChild((xmlNodePtr)genericPtr, (xmlNodePtr)attribute->genericPtr);
|
||||
|
||||
// The attribute is now part of the xml tree heirarchy
|
||||
attribute->owner = self;
|
||||
}
|
||||
|
||||
- (void)removeAttributeForName:(NSString *)name
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
[self _removeAttributeForName:name];
|
||||
}
|
||||
|
||||
- (NSArray *)attributes
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
NSMutableArray *result = [NSMutableArray array];
|
||||
|
||||
xmlAttrPtr attr = ((xmlNodePtr)genericPtr)->properties;
|
||||
while (attr != NULL)
|
||||
{
|
||||
[result addObject:[DDXMLAttributeNode nodeWithAttrPrimitive:attr owner:self]];
|
||||
|
||||
attr = attr->next;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (DDXMLNode *)attributeForName:(NSString *)name
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
xmlAttrPtr attr = ((xmlNodePtr)genericPtr)->properties;
|
||||
if (attr)
|
||||
{
|
||||
const xmlChar *xmlName = [name xmlChar];
|
||||
do
|
||||
{
|
||||
if (attr->ns && attr->ns->prefix)
|
||||
{
|
||||
// If the attribute name was originally something like "xml:quack",
|
||||
// then attr->name is "quack" and attr->ns->prefix is "xml".
|
||||
//
|
||||
// So if the user is searching for "xml:quack" we need to take the prefix into account.
|
||||
// Note that "xml:quack" is what would be printed if we output the attribute.
|
||||
|
||||
if (xmlStrQEqual(attr->ns->prefix, attr->name, xmlName))
|
||||
{
|
||||
return [DDXMLAttributeNode nodeWithAttrPrimitive:attr owner:self];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (xmlStrEqual(attr->name, xmlName))
|
||||
{
|
||||
return [DDXMLAttributeNode nodeWithAttrPrimitive:attr owner:self];
|
||||
}
|
||||
}
|
||||
|
||||
attr = attr->next;
|
||||
|
||||
} while (attr);
|
||||
}
|
||||
return nil;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the list of attributes for the element.
|
||||
* Any previously set attributes are removed.
|
||||
**/
|
||||
- (void)setAttributes:(NSArray *)attributes
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
[DDXMLNode removeAllAttributesFromNode:(xmlNodePtr)genericPtr];
|
||||
|
||||
NSUInteger i;
|
||||
for (i = 0; i < [attributes count]; i++)
|
||||
{
|
||||
DDXMLNode *attribute = [attributes objectAtIndex:i];
|
||||
[self addAttribute:attribute];
|
||||
|
||||
// Note: The addAttributes method properly sets the freeOnDealloc ivar.
|
||||
}
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark Namespaces
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
- (void)_removeNamespaceForPrefix:(NSString *)name
|
||||
{
|
||||
xmlNodePtr node = (xmlNodePtr)genericPtr;
|
||||
|
||||
// If name is nil or the empty string, the user is wishing to remove the default namespace
|
||||
const xmlChar *xmlName = [name length] > 0 ? [name xmlChar] : NULL;
|
||||
|
||||
xmlNsPtr ns = node->nsDef;
|
||||
while (ns != NULL)
|
||||
{
|
||||
if (xmlStrEqual(ns->prefix, xmlName))
|
||||
{
|
||||
[DDXMLNode removeNamespace:ns fromNode:node];
|
||||
break;
|
||||
}
|
||||
ns = ns->next;
|
||||
}
|
||||
|
||||
// Note: The removeNamespace method properly handles the situation where the namespace is the default namespace
|
||||
}
|
||||
|
||||
- (void)_addNamespace:(DDXMLNode *)namespace
|
||||
{
|
||||
// NSXML version uses this same assertion
|
||||
DDXMLAssert([namespace _hasParent] == NO, @"Cannot add a namespace with a parent; detach or copy first");
|
||||
DDXMLAssert(IsXmlNsPtr(namespace->genericPtr), @"Not a namespace");
|
||||
|
||||
xmlNodePtr node = (xmlNodePtr)genericPtr;
|
||||
xmlNsPtr ns = (xmlNsPtr)namespace->genericPtr;
|
||||
|
||||
// Beware: [namespace prefix] does NOT return what you might expect. Use [namespace name] instead.
|
||||
|
||||
NSString *namespaceName = [namespace name];
|
||||
|
||||
[self _removeNamespaceForPrefix:namespaceName];
|
||||
|
||||
xmlNsPtr currentNs = node->nsDef;
|
||||
if (currentNs == NULL)
|
||||
{
|
||||
node->nsDef = ns;
|
||||
}
|
||||
else
|
||||
{
|
||||
while (currentNs->next != NULL)
|
||||
{
|
||||
currentNs = currentNs->next;
|
||||
}
|
||||
|
||||
currentNs->next = ns;
|
||||
}
|
||||
|
||||
// The namespace is now part of the xml tree heirarchy
|
||||
namespace->owner = self;
|
||||
|
||||
if ([namespace isKindOfClass:[DDXMLNamespaceNode class]])
|
||||
{
|
||||
DDXMLNamespaceNode *ddNamespace = (DDXMLNamespaceNode *)namespace;
|
||||
|
||||
// The xmlNs structure doesn't contain a reference to the parent, so we manage our own reference
|
||||
[ddNamespace _setNsParentPtr:node];
|
||||
}
|
||||
|
||||
// Did we just add a default namespace
|
||||
if ([namespaceName isEqualToString:@""])
|
||||
{
|
||||
node->ns = ns;
|
||||
|
||||
// Note: The removeNamespaceForPrefix method above properly handled removing any previous default namespace
|
||||
}
|
||||
}
|
||||
|
||||
- (void)addNamespace:(DDXMLNode *)namespace
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
[self _addNamespace:namespace];
|
||||
}
|
||||
|
||||
- (void)removeNamespaceForPrefix:(NSString *)name
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
[self _removeNamespaceForPrefix:name];
|
||||
}
|
||||
|
||||
- (NSArray *)namespaces
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
NSMutableArray *result = [NSMutableArray array];
|
||||
|
||||
xmlNsPtr ns = ((xmlNodePtr)genericPtr)->nsDef;
|
||||
while (ns != NULL)
|
||||
{
|
||||
[result addObject:[DDXMLNamespaceNode nodeWithNsPrimitive:ns nsParent:(xmlNodePtr)genericPtr owner:self]];
|
||||
|
||||
ns = ns->next;
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
- (DDXMLNode *)namespaceForPrefix:(NSString *)prefix
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
// If the prefix is nil or the empty string, the user is requesting the default namespace
|
||||
|
||||
if ([prefix length] == 0)
|
||||
{
|
||||
// Requesting the default namespace
|
||||
xmlNsPtr ns = ((xmlNodePtr)genericPtr)->ns;
|
||||
if (ns != NULL)
|
||||
{
|
||||
return [DDXMLNamespaceNode nodeWithNsPrimitive:ns nsParent:(xmlNodePtr)genericPtr owner:self];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
xmlNsPtr ns = ((xmlNodePtr)genericPtr)->nsDef;
|
||||
if (ns)
|
||||
{
|
||||
const xmlChar *xmlPrefix = [prefix xmlChar];
|
||||
do
|
||||
{
|
||||
if (xmlStrEqual(ns->prefix, xmlPrefix))
|
||||
{
|
||||
return [DDXMLNamespaceNode nodeWithNsPrimitive:ns nsParent:(xmlNodePtr)genericPtr owner:self];
|
||||
}
|
||||
ns = ns->next;
|
||||
|
||||
} while (ns);
|
||||
}
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
- (void)setNamespaces:(NSArray *)namespaces
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
[DDXMLNode removeAllNamespacesFromNode:(xmlNodePtr)genericPtr];
|
||||
|
||||
NSUInteger i;
|
||||
for (i = 0; i < [namespaces count]; i++)
|
||||
{
|
||||
DDXMLNode *namespace = [namespaces objectAtIndex:i];
|
||||
[self _addNamespace:namespace];
|
||||
|
||||
// Note: The addNamespace method properly sets the freeOnDealloc ivar.
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively searches the given node for the given namespace
|
||||
**/
|
||||
- (DDXMLNode *)_recursiveResolveNamespaceForPrefix:(NSString *)prefix atNode:(xmlNodePtr)nodePtr
|
||||
{
|
||||
// This is a private/internal method
|
||||
|
||||
if (nodePtr == NULL) return nil;
|
||||
|
||||
xmlNsPtr ns = nodePtr->nsDef;
|
||||
if (ns)
|
||||
{
|
||||
const xmlChar *xmlPrefix = [prefix xmlChar];
|
||||
do
|
||||
{
|
||||
if (xmlStrEqual(ns->prefix, xmlPrefix))
|
||||
{
|
||||
return [DDXMLNamespaceNode nodeWithNsPrimitive:ns nsParent:nodePtr owner:self];
|
||||
}
|
||||
ns = ns->next;
|
||||
|
||||
} while(ns);
|
||||
}
|
||||
|
||||
return [self _recursiveResolveNamespaceForPrefix:prefix atNode:nodePtr->parent];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the namespace node with the prefix matching the given qualified name.
|
||||
* Eg: You pass it "a:dog", it returns the namespace (defined in this node or parent nodes) that has the "a" prefix.
|
||||
**/
|
||||
- (DDXMLNode *)resolveNamespaceForName:(NSString *)name
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
// If the user passes nil or an empty string for name, they're looking for the default namespace.
|
||||
if ([name length] == 0)
|
||||
{
|
||||
return [self _recursiveResolveNamespaceForPrefix:nil atNode:(xmlNodePtr)genericPtr];
|
||||
}
|
||||
|
||||
NSString *prefix = [[self class] prefixForName:name];
|
||||
|
||||
if ([prefix length] > 0)
|
||||
{
|
||||
// Unfortunately we can't use xmlSearchNs because it returns an xmlNsPtr.
|
||||
// This gives us mostly what we want, except we also need to know the nsParent.
|
||||
// So we do the recursive search ourselves.
|
||||
|
||||
return [self _recursiveResolveNamespaceForPrefix:prefix atNode:(xmlNodePtr)genericPtr];
|
||||
}
|
||||
|
||||
return nil;
|
||||
}
|
||||
|
||||
/**
|
||||
* Recursively searches the given node for a namespace with the given URI, and a set prefix.
|
||||
**/
|
||||
- (NSString *)_recursiveResolvePrefixForURI:(NSString *)uri atNode:(xmlNodePtr)nodePtr
|
||||
{
|
||||
// This is a private/internal method
|
||||
|
||||
if (nodePtr == NULL) return nil;
|
||||
|
||||
xmlNsPtr ns = nodePtr->nsDef;
|
||||
if (ns)
|
||||
{
|
||||
const xmlChar *xmlUri = [uri xmlChar];
|
||||
do
|
||||
{
|
||||
if (xmlStrEqual(ns->href, xmlUri))
|
||||
{
|
||||
if (ns->prefix != NULL)
|
||||
{
|
||||
return [NSString stringWithUTF8String:((const char *)ns->prefix)];
|
||||
}
|
||||
}
|
||||
ns = ns->next;
|
||||
|
||||
} while (ns);
|
||||
}
|
||||
|
||||
return [self _recursiveResolvePrefixForURI:uri atNode:nodePtr->parent];
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the prefix associated with the specified URI.
|
||||
* Returns a string that is the matching prefix or nil if it finds no matching prefix.
|
||||
**/
|
||||
- (NSString *)resolvePrefixForNamespaceURI:(NSString *)namespaceURI
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
// We can't use xmlSearchNsByHref because it will return xmlNsPtr's with NULL prefixes.
|
||||
// We're looking for a definitive prefix for the given URI.
|
||||
|
||||
return [self _recursiveResolvePrefixForURI:namespaceURI atNode:(xmlNodePtr)genericPtr];
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark Children
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
- (void)addChild:(DDXMLNode *)child
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
// NSXML version uses these same assertions
|
||||
DDXMLAssert([child _hasParent] == NO, @"Cannot add a child that has a parent; detach or copy first");
|
||||
DDXMLAssert(IsXmlNodePtr(child->genericPtr),
|
||||
@"Elements can only have text, elements, processing instructions, and comments as children");
|
||||
|
||||
xmlAddChild((xmlNodePtr)genericPtr, (xmlNodePtr)child->genericPtr);
|
||||
|
||||
// The node is now part of the xml tree heirarchy
|
||||
child->owner = self;
|
||||
}
|
||||
|
||||
- (void)insertChild:(DDXMLNode *)child atIndex:(NSUInteger)index
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
// NSXML version uses these same assertions
|
||||
DDXMLAssert([child _hasParent] == NO, @"Cannot add a child that has a parent; detach or copy first");
|
||||
DDXMLAssert(IsXmlNodePtr(child->genericPtr),
|
||||
@"Elements can only have text, elements, processing instructions, and comments as children");
|
||||
|
||||
NSUInteger i = 0;
|
||||
|
||||
xmlNodePtr childNodePtr = ((xmlNodePtr)genericPtr)->children;
|
||||
while (childNodePtr != NULL)
|
||||
{
|
||||
// Ignore all but element, comment, text, or processing instruction nodes
|
||||
if (IsXmlNodePtr(childNodePtr))
|
||||
{
|
||||
if (i == index)
|
||||
{
|
||||
xmlAddPrevSibling(childNodePtr, (xmlNodePtr)child->genericPtr);
|
||||
|
||||
child->owner = self;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
childNodePtr = childNodePtr->next;
|
||||
}
|
||||
|
||||
if (i == index)
|
||||
{
|
||||
xmlAddChild((xmlNodePtr)genericPtr, (xmlNodePtr)child->genericPtr);
|
||||
|
||||
child->owner = self;
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
// NSXML version uses this same assertion
|
||||
DDXMLAssert(NO, @"index (%u) beyond bounds (%u)", (unsigned)index, (unsigned)++i);
|
||||
}
|
||||
|
||||
- (void)removeChildAtIndex:(NSUInteger)index
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
NSUInteger i = 0;
|
||||
|
||||
xmlNodePtr child = ((xmlNodePtr)genericPtr)->children;
|
||||
while (child != NULL)
|
||||
{
|
||||
// Ignore all but element, comment, text, or processing instruction nodes
|
||||
if (IsXmlNodePtr(child))
|
||||
{
|
||||
if (i == index)
|
||||
{
|
||||
[DDXMLNode removeChild:child];
|
||||
return;
|
||||
}
|
||||
|
||||
i++;
|
||||
}
|
||||
child = child->next;
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setChildren:(NSArray *)children
|
||||
{
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
DDXMLNotZombieAssert();
|
||||
#endif
|
||||
|
||||
[DDXMLNode removeAllChildrenFromNode:(xmlNodePtr)genericPtr];
|
||||
|
||||
NSUInteger i;
|
||||
for (i = 0; i < [children count]; i++)
|
||||
{
|
||||
DDXMLNode *child = [children objectAtIndex:i];
|
||||
[self addChild:child];
|
||||
|
||||
// Note: The addChild method properly sets the freeOnDealloc ivar.
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,161 +0,0 @@
|
||||
#import <Foundation/Foundation.h>
|
||||
|
||||
#if !(TARGET_IPHONE_SIMULATOR)
|
||||
@import libxml;
|
||||
#else
|
||||
@import libxmlSimu;
|
||||
#endif
|
||||
|
||||
@class DDXMLDocument;
|
||||
|
||||
/**
|
||||
* Welcome to KissXML.
|
||||
*
|
||||
* The project page has documentation if you have questions.
|
||||
* https://github.com/robbiehanson/KissXML
|
||||
*
|
||||
* If you're new to the project you may wish to read the "Getting Started" wiki.
|
||||
* https://github.com/robbiehanson/KissXML/wiki/GettingStarted
|
||||
*
|
||||
* KissXML provides a drop-in replacement for Apple's NSXML class cluster.
|
||||
* The goal is to get the exact same behavior as the NSXML classes.
|
||||
*
|
||||
* For API Reference, see Apple's excellent documentation,
|
||||
* either via Xcode's Mac OS X documentation, or via the web:
|
||||
*
|
||||
* https://github.com/robbiehanson/KissXML/wiki/Reference
|
||||
**/
|
||||
|
||||
enum {
|
||||
DDXMLInvalidKind = 0,
|
||||
DDXMLDocumentKind = XML_DOCUMENT_NODE,
|
||||
DDXMLElementKind = XML_ELEMENT_NODE,
|
||||
DDXMLAttributeKind = XML_ATTRIBUTE_NODE,
|
||||
DDXMLNamespaceKind = XML_NAMESPACE_DECL,
|
||||
DDXMLProcessingInstructionKind = XML_PI_NODE,
|
||||
DDXMLCommentKind = XML_COMMENT_NODE,
|
||||
DDXMLTextKind = XML_TEXT_NODE,
|
||||
DDXMLDTDKind = XML_DTD_NODE,
|
||||
DDXMLEntityDeclarationKind = XML_ENTITY_DECL,
|
||||
DDXMLAttributeDeclarationKind = XML_ATTRIBUTE_DECL,
|
||||
DDXMLElementDeclarationKind = XML_ELEMENT_DECL,
|
||||
DDXMLNotationDeclarationKind = XML_NOTATION_NODE
|
||||
};
|
||||
typedef NSUInteger DDXMLNodeKind;
|
||||
|
||||
enum {
|
||||
DDXMLNodeOptionsNone = 0,
|
||||
DDXMLNodeExpandEmptyElement = 1 << 1,
|
||||
DDXMLNodeCompactEmptyElement = 1 << 2,
|
||||
DDXMLNodePrettyPrint = 1 << 17,
|
||||
};
|
||||
|
||||
|
||||
//extern struct _xmlKind;
|
||||
|
||||
|
||||
@interface DDXMLNode : NSObject <NSCopying>
|
||||
{
|
||||
// Every DDXML object is simply a wrapper around an underlying libxml node
|
||||
struct _xmlKind *genericPtr;
|
||||
|
||||
// Every libxml node resides somewhere within an xml tree heirarchy.
|
||||
// We cannot free the tree heirarchy until all referencing nodes have been released.
|
||||
// So all nodes retain a reference to the node that created them,
|
||||
// and when the last reference is released the tree gets freed.
|
||||
DDXMLNode *owner;
|
||||
}
|
||||
|
||||
//- (id)initWithKind:(DDXMLNodeKind)kind;
|
||||
|
||||
//- (id)initWithKind:(DDXMLNodeKind)kind options:(NSUInteger)options;
|
||||
|
||||
//+ (id)document;
|
||||
|
||||
//+ (id)documentWithRootElement:(DDXMLElement *)element;
|
||||
|
||||
+ (id)elementWithName:(NSString *)name;
|
||||
|
||||
+ (id)elementWithName:(NSString *)name URI:(NSString *)URI;
|
||||
|
||||
+ (id)elementWithName:(NSString *)name stringValue:(NSString *)string;
|
||||
|
||||
+ (id)elementWithName:(NSString *)name children:(NSArray *)children attributes:(NSArray *)attributes;
|
||||
|
||||
+ (id)attributeWithName:(NSString *)name stringValue:(NSString *)stringValue;
|
||||
|
||||
+ (id)attributeWithName:(NSString *)name URI:(NSString *)URI stringValue:(NSString *)stringValue;
|
||||
|
||||
+ (id)namespaceWithName:(NSString *)name stringValue:(NSString *)stringValue;
|
||||
|
||||
+ (id)processingInstructionWithName:(NSString *)name stringValue:(NSString *)stringValue;
|
||||
|
||||
+ (id)commentWithStringValue:(NSString *)stringValue;
|
||||
|
||||
+ (id)textWithStringValue:(NSString *)stringValue;
|
||||
|
||||
//+ (id)DTDNodeWithXMLString:(NSString *)string;
|
||||
|
||||
#pragma mark --- Properties ---
|
||||
|
||||
- (DDXMLNodeKind)kind;
|
||||
|
||||
- (void)setName:(NSString *)name;
|
||||
- (NSString *)name;
|
||||
|
||||
//- (void)setObjectValue:(id)value;
|
||||
//- (id)objectValue;
|
||||
|
||||
- (void)setStringValue:(NSString *)string;
|
||||
//- (void)setStringValue:(NSString *)string resolvingEntities:(BOOL)resolve;
|
||||
- (NSString *)stringValue;
|
||||
|
||||
#pragma mark --- Tree Navigation ---
|
||||
|
||||
- (NSUInteger)index;
|
||||
|
||||
- (NSUInteger)level;
|
||||
|
||||
- (DDXMLDocument *)rootDocument;
|
||||
|
||||
- (DDXMLNode *)parent;
|
||||
- (NSUInteger)childCount;
|
||||
- (NSArray *)children;
|
||||
- (DDXMLNode *)childAtIndex:(NSUInteger)index;
|
||||
|
||||
- (DDXMLNode *)previousSibling;
|
||||
- (DDXMLNode *)nextSibling;
|
||||
|
||||
- (DDXMLNode *)previousNode;
|
||||
- (DDXMLNode *)nextNode;
|
||||
|
||||
- (void)detach;
|
||||
|
||||
- (NSString *)XPath;
|
||||
|
||||
#pragma mark --- QNames ---
|
||||
|
||||
- (NSString *)localName;
|
||||
- (NSString *)prefix;
|
||||
|
||||
- (void)setURI:(NSString *)URI;
|
||||
- (NSString *)URI;
|
||||
|
||||
+ (NSString *)localNameForName:(NSString *)name;
|
||||
+ (NSString *)prefixForName:(NSString *)name;
|
||||
//+ (DDXMLNode *)predefinedNamespaceForPrefix:(NSString *)name;
|
||||
|
||||
#pragma mark --- Output ---
|
||||
|
||||
- (NSString *)description;
|
||||
- (NSString *)XMLString;
|
||||
- (NSString *)XMLStringWithOptions:(NSUInteger)options;
|
||||
//- (NSString *)canonicalXMLStringPreservingComments:(BOOL)comments;
|
||||
|
||||
#pragma mark --- XPath/XQuery ---
|
||||
|
||||
- (NSArray *)nodesForXPath:(NSString *)xpath error:(NSError **)error;
|
||||
//- (NSArray *)objectsForXQuery:(NSString *)xquery constants:(NSDictionary *)constants error:(NSError **)error;
|
||||
//- (NSArray *)objectsForXQuery:(NSString *)xquery error:(NSError **)error;
|
||||
|
||||
@end
|
||||
@@ -1,229 +0,0 @@
|
||||
#import "DDXML.h"
|
||||
|
||||
|
||||
// We can't rely solely on NSAssert, because many developers disable them for release builds.
|
||||
// Our API contract requires us to keep these assertions intact.
|
||||
#define DDXMLAssert(condition, desc, ...) \
|
||||
do{ \
|
||||
if(!(condition)) { \
|
||||
[[NSAssertionHandler currentHandler] handleFailureInMethod:_cmd \
|
||||
object:self \
|
||||
file:[NSString stringWithUTF8String:__FILE__] \
|
||||
lineNumber:__LINE__ \
|
||||
description:(desc), ##__VA_ARGS__]; \
|
||||
} \
|
||||
}while(NO)
|
||||
|
||||
|
||||
// Create assertion to ensure xml node is not a zombie.
|
||||
#if DDXML_DEBUG_MEMORY_ISSUES
|
||||
#define DDXMLNotZombieAssert() \
|
||||
do{ \
|
||||
if(DDXMLIsZombie(genericPtr, self)) { \
|
||||
NSString *desc = @"XML node is a zombie - It's parent structure has been freed!"; \
|
||||
[[NSAssertionHandler currentHandler] handleFailureInMethod:_cmd \
|
||||
object:self \
|
||||
file:[NSString stringWithUTF8String:__FILE__] \
|
||||
lineNumber:__LINE__ \
|
||||
description:desc]; \
|
||||
} \
|
||||
}while(NO)
|
||||
#endif
|
||||
|
||||
#define DDLastErrorKey @"DDXML:LastError"
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* DDXMLNode can represent several underlying types, such as xmlNodePtr, xmlDocPtr, xmlAttrPtr, xmlNsPtr, etc.
|
||||
* All of these are pointers to structures, and all of those structures start with a pointer, and a type.
|
||||
* The xmlKind struct is used as a generic structure, and a stepping stone.
|
||||
* We use it to check the type of a structure, and then perform the appropriate cast.
|
||||
*
|
||||
* For example:
|
||||
* if(genericPtr->type == XML_ATTRIBUTE_NODE)
|
||||
* {
|
||||
* xmlAttrPtr attr = (xmlAttrPtr)genericPtr;
|
||||
* // Do something with attr
|
||||
* }
|
||||
**/
|
||||
struct _xmlKind {
|
||||
void * ignore;
|
||||
xmlElementType type;
|
||||
};
|
||||
typedef struct _xmlKind *xmlKindPtr;
|
||||
|
||||
/**
|
||||
* Most xml types all start with this standard structure. In fact, all do except the xmlNsPtr.
|
||||
* We will occasionally take advantage of this to simplify code when the code wouldn't vary from type to type.
|
||||
* Obviously, you cannnot cast a xmlNsPtr to a xmlStdPtr.
|
||||
**/
|
||||
struct _xmlStd {
|
||||
void * _private;
|
||||
xmlElementType type;
|
||||
const xmlChar *name;
|
||||
struct _xmlNode *children;
|
||||
struct _xmlNode *last;
|
||||
struct _xmlNode *parent;
|
||||
struct _xmlStd *next;
|
||||
struct _xmlStd *prev;
|
||||
struct _xmlDoc *doc;
|
||||
};
|
||||
typedef struct _xmlStd *xmlStdPtr;
|
||||
|
||||
|
||||
NS_INLINE BOOL IsXmlAttrPtr(void *kindPtr)
|
||||
{
|
||||
return ((xmlKindPtr)kindPtr)->type == XML_ATTRIBUTE_NODE;
|
||||
}
|
||||
|
||||
NS_INLINE BOOL IsXmlNodePtr(void *kindPtr)
|
||||
{
|
||||
switch (((xmlKindPtr)kindPtr)->type)
|
||||
{
|
||||
case XML_ELEMENT_NODE :
|
||||
case XML_PI_NODE :
|
||||
case XML_COMMENT_NODE :
|
||||
case XML_TEXT_NODE :
|
||||
case XML_CDATA_SECTION_NODE : return YES;
|
||||
default : return NO;
|
||||
}
|
||||
}
|
||||
|
||||
NS_INLINE BOOL IsXmlDocPtr(void *kindPtr)
|
||||
{
|
||||
return ((xmlKindPtr)kindPtr)->type == XML_DOCUMENT_NODE;
|
||||
}
|
||||
|
||||
NS_INLINE BOOL IsXmlDtdPtr(void *kindPtr)
|
||||
{
|
||||
return ((xmlKindPtr)kindPtr)->type == XML_DTD_NODE;
|
||||
}
|
||||
|
||||
NS_INLINE BOOL IsXmlNsPtr(void *kindPtr)
|
||||
{
|
||||
return ((xmlKindPtr)kindPtr)->type == XML_NAMESPACE_DECL;
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface DDXMLNamespaceNode : DDXMLNode
|
||||
{
|
||||
// The xmlNsPtr type doesn't store a reference to it's parent.
|
||||
// This is here to fix the problem, and make this class more compatible with the NSXML classes.
|
||||
xmlNodePtr nsParentPtr;
|
||||
}
|
||||
|
||||
+ (id)nodeWithNsPrimitive:(xmlNsPtr)ns nsParent:(xmlNodePtr)parent owner:(DDXMLNode *)owner;
|
||||
- (id)initWithNsPrimitive:(xmlNsPtr)ns nsParent:(xmlNodePtr)parent owner:(DDXMLNode *)owner;
|
||||
|
||||
- (xmlNodePtr)_nsParentPtr;
|
||||
- (void)_setNsParentPtr:(xmlNodePtr)parentPtr;
|
||||
|
||||
// Overrides several methods in DDXMLNode
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface DDXMLAttributeNode : DDXMLNode
|
||||
{
|
||||
// The xmlAttrPtr type doesn't allow for ownership of a namespace.
|
||||
//
|
||||
// In other types, such as xmlNodePtr:
|
||||
// - nsDef stores namespaces that are owned by the node (have been alloced by the node).
|
||||
// - ns is simply a pointer to the default namespace of the node, which may or may not reside in its own nsDef list.
|
||||
//
|
||||
// The xmlAttrPtr only has a ns, it doesn't have a nsDef list.
|
||||
// Which completely makes sense really, since namespaces have to be defined elsewhere.
|
||||
//
|
||||
// This is here to maintain compatibility with the NSXML classes,
|
||||
// where one can assign a namespace to an attribute independently.
|
||||
xmlNsPtr attrNsPtr;
|
||||
}
|
||||
|
||||
+ (id)nodeWithAttrPrimitive:(xmlAttrPtr)attr owner:(DDXMLNode *)owner;
|
||||
- (id)initWithAttrPrimitive:(xmlAttrPtr)attr owner:(DDXMLNode *)owner;
|
||||
|
||||
// Overrides several methods in DDXMLNode
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface DDXMLInvalidNode : DDXMLNode
|
||||
{
|
||||
}
|
||||
|
||||
// Overrides several methods in DDXMLNode
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface DDXMLNode (PrivateAPI)
|
||||
|
||||
+ (id)nodeWithUnknownPrimitive:(xmlKindPtr)kindPtr owner:(DDXMLNode *)owner;
|
||||
|
||||
+ (id)nodeWithPrimitive:(xmlKindPtr)kindPtr owner:(DDXMLNode *)owner;
|
||||
- (id)initWithPrimitive:(xmlKindPtr)kindPtr owner:(DDXMLNode *)owner;
|
||||
|
||||
- (BOOL)_hasParent;
|
||||
|
||||
+ (void)getHasPrefix:(BOOL *)hasPrefixPtr localName:(NSString **)localNamePtr forName:(NSString *)name;
|
||||
+ (void)getPrefix:(NSString **)prefixPtr localName:(NSString **)localNamePtr forName:(NSString *)name;
|
||||
|
||||
+ (void)recursiveStripDocPointersFromNode:(xmlNodePtr)node;
|
||||
|
||||
+ (void)detachNamespace:(xmlNsPtr)ns fromNode:(xmlNodePtr)node;
|
||||
+ (void)removeNamespace:(xmlNsPtr)ns fromNode:(xmlNodePtr)node;
|
||||
+ (void)removeAllNamespacesFromNode:(xmlNodePtr)node;
|
||||
|
||||
+ (void)detachAttribute:(xmlAttrPtr)attr andClean:(BOOL)clean;
|
||||
+ (void)detachAttribute:(xmlAttrPtr)attr;
|
||||
+ (void)removeAttribute:(xmlAttrPtr)attr;
|
||||
+ (void)removeAllAttributesFromNode:(xmlNodePtr)node;
|
||||
|
||||
+ (void)detachChild:(xmlNodePtr)child andClean:(BOOL)clean andFixNamespaces:(BOOL)fixNamespaces;
|
||||
+ (void)detachChild:(xmlNodePtr)child;
|
||||
+ (void)removeChild:(xmlNodePtr)child;
|
||||
+ (void)removeAllChildrenFromNode:(xmlNodePtr)node;
|
||||
|
||||
BOOL DDXMLIsZombie(void *xmlPtr, DDXMLNode *wrapper);
|
||||
|
||||
+ (NSError *)lastError;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface DDXMLElement (PrivateAPI)
|
||||
|
||||
+ (id)nodeWithElementPrimitive:(xmlNodePtr)node owner:(DDXMLNode *)owner;
|
||||
- (id)initWithElementPrimitive:(xmlNodePtr)node owner:(DDXMLNode *)owner;
|
||||
|
||||
- (DDXMLNode *)_recursiveResolveNamespaceForPrefix:(NSString *)prefix atNode:(xmlNodePtr)nodePtr;
|
||||
- (NSString *)_recursiveResolvePrefixForURI:(NSString *)uri atNode:(xmlNodePtr)nodePtr;
|
||||
|
||||
@end
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
#pragma mark -
|
||||
////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@interface DDXMLDocument (PrivateAPI)
|
||||
|
||||
+ (id)nodeWithDocPrimitive:(xmlDocPtr)doc owner:(DDXMLNode *)owner;
|
||||
- (id)initWithDocPrimitive:(xmlDocPtr)doc owner:(DDXMLNode *)owner;
|
||||
|
||||
@end
|
||||
@@ -1,22 +0,0 @@
|
||||
samples/Hackbook/build/
|
||||
samples/Hackbook/Hackbook.xcodeproj/*.pbxuser
|
||||
samples/Hackbook/Hackbook.xcodeproj/*.mode*
|
||||
samples/Hackbook/Hackbook.xcodeproj/xcuserdata*
|
||||
samples/Hackbook/Hackbook.xcodeproj/project.xcworkspace
|
||||
src/facebook-ios-sdk.xcodeproj/*.pbxuser
|
||||
src/facebook-ios-sdk.xcodeproj/*.mode*
|
||||
src/build/
|
||||
build/
|
||||
lib/
|
||||
test/UnitTest/UnitTest.xcodeproj/*.pbxuser
|
||||
test/UnitTest/UnitTest.xcodeproj/*.mode*
|
||||
test/UnitTest/build/
|
||||
*~
|
||||
*#
|
||||
.DS_Store
|
||||
project.xcworkspace
|
||||
xcuserdata
|
||||
.arc
|
||||
.arcconfig
|
||||
.internal/
|
||||
TestAppIdAndSecret.xcconfig
|
||||
@@ -1,9 +0,0 @@
|
||||
[submodule "vendor/OHHTTPStubs"]
|
||||
path = vendor/OHHTTPStubs
|
||||
url = git://github.com/AliSoftware/OHHTTPStubs.git
|
||||
[submodule "vendor/OCMock"]
|
||||
path = vendor/OCMock
|
||||
url = git://github.com/erikdoe/ocmock
|
||||
[submodule "vendor/OCHamcrest"]
|
||||
path = vendor/OCHamcrest
|
||||
url = git://github.com/hamcrest/OCHamcrest
|
||||
@@ -1,15 +0,0 @@
|
||||
Facebook welcomes contributions to our SDKs.
|
||||
|
||||
All contributors must sign a CLA (contributor license agreement) here:
|
||||
|
||||
https://developers.facebook.com/opensource/cla
|
||||
|
||||
To contribute on behalf of your employer, sign the company CLA
|
||||
To contribute on behalf of yourself, sign the individual CLA
|
||||
|
||||
All contributions:
|
||||
|
||||
1/ MUST be be licensed using the Apache License, Version 2.0
|
||||
2/ authors MAY retain copyright by adding their copyright notice to the appropriate flies
|
||||
|
||||
More information on the Apache License can be found here: http://www.apache.org/foundation/license-faq.html
|
||||
@@ -1,201 +0,0 @@
|
||||
Apache License
|
||||
Version 2.0, January 2004
|
||||
http://www.apache.org/licenses/
|
||||
|
||||
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
||||
|
||||
1. Definitions.
|
||||
|
||||
"License" shall mean the terms and conditions for use, reproduction,
|
||||
and distribution as defined by Sections 1 through 9 of this document.
|
||||
|
||||
"Licensor" shall mean the copyright owner or entity authorized by
|
||||
the copyright owner that is granting the License.
|
||||
|
||||
"Legal Entity" shall mean the union of the acting entity and all
|
||||
other entities that control, are controlled by, or are under common
|
||||
control with that entity. For the purposes of this definition,
|
||||
"control" means (i) the power, direct or indirect, to cause the
|
||||
direction or management of such entity, whether by contract or
|
||||
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
||||
outstanding shares, or (iii) beneficial ownership of such entity.
|
||||
|
||||
"You" (or "Your") shall mean an individual or Legal Entity
|
||||
exercising permissions granted by this License.
|
||||
|
||||
"Source" form shall mean the preferred form for making modifications,
|
||||
including but not limited to software source code, documentation
|
||||
source, and configuration files.
|
||||
|
||||
"Object" form shall mean any form resulting from mechanical
|
||||
transformation or translation of a Source form, including but
|
||||
not limited to compiled object code, generated documentation,
|
||||
and conversions to other media types.
|
||||
|
||||
"Work" shall mean the work of authorship, whether in Source or
|
||||
Object form, made available under the License, as indicated by a
|
||||
copyright notice that is included in or attached to the work
|
||||
(an example is provided in the Appendix below).
|
||||
|
||||
"Derivative Works" shall mean any work, whether in Source or Object
|
||||
form, that is based on (or derived from) the Work and for which the
|
||||
editorial revisions, annotations, elaborations, or other modifications
|
||||
represent, as a whole, an original work of authorship. For the purposes
|
||||
of this License, Derivative Works shall not include works that remain
|
||||
separable from, or merely link (or bind by name) to the interfaces of,
|
||||
the Work and Derivative Works thereof.
|
||||
|
||||
"Contribution" shall mean any work of authorship, including
|
||||
the original version of the Work and any modifications or additions
|
||||
to that Work or Derivative Works thereof, that is intentionally
|
||||
submitted to Licensor for inclusion in the Work by the copyright owner
|
||||
or by an individual or Legal Entity authorized to submit on behalf of
|
||||
the copyright owner. For the purposes of this definition, "submitted"
|
||||
means any form of electronic, verbal, or written communication sent
|
||||
to the Licensor or its representatives, including but not limited to
|
||||
communication on electronic mailing lists, source code control systems,
|
||||
and issue tracking systems that are managed by, or on behalf of, the
|
||||
Licensor for the purpose of discussing and improving the Work, but
|
||||
excluding communication that is conspicuously marked or otherwise
|
||||
designated in writing by the copyright owner as "Not a Contribution."
|
||||
|
||||
"Contributor" shall mean Licensor and any individual or Legal Entity
|
||||
on behalf of whom a Contribution has been received by Licensor and
|
||||
subsequently incorporated within the Work.
|
||||
|
||||
2. Grant of Copyright License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
copyright license to reproduce, prepare Derivative Works of,
|
||||
publicly display, publicly perform, sublicense, and distribute the
|
||||
Work and such Derivative Works in Source or Object form.
|
||||
|
||||
3. Grant of Patent License. Subject to the terms and conditions of
|
||||
this License, each Contributor hereby grants to You a perpetual,
|
||||
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
||||
(except as stated in this section) patent license to make, have made,
|
||||
use, offer to sell, sell, import, and otherwise transfer the Work,
|
||||
where such license applies only to those patent claims licensable
|
||||
by such Contributor that are necessarily infringed by their
|
||||
Contribution(s) alone or by combination of their Contribution(s)
|
||||
with the Work to which such Contribution(s) was submitted. If You
|
||||
institute patent litigation against any entity (including a
|
||||
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
||||
or a Contribution incorporated within the Work constitutes direct
|
||||
or contributory patent infringement, then any patent licenses
|
||||
granted to You under this License for that Work shall terminate
|
||||
as of the date such litigation is filed.
|
||||
|
||||
4. Redistribution. You may reproduce and distribute copies of the
|
||||
Work or Derivative Works thereof in any medium, with or without
|
||||
modifications, and in Source or Object form, provided that You
|
||||
meet the following conditions:
|
||||
|
||||
(a) You must give any other recipients of the Work or
|
||||
Derivative Works a copy of this License; and
|
||||
|
||||
(b) You must cause any modified files to carry prominent notices
|
||||
stating that You changed the files; and
|
||||
|
||||
(c) You must retain, in the Source form of any Derivative Works
|
||||
that You distribute, all copyright, patent, trademark, and
|
||||
attribution notices from the Source form of the Work,
|
||||
excluding those notices that do not pertain to any part of
|
||||
the Derivative Works; and
|
||||
|
||||
(d) If the Work includes a "NOTICE" text file as part of its
|
||||
distribution, then any Derivative Works that You distribute must
|
||||
include a readable copy of the attribution notices contained
|
||||
within such NOTICE file, excluding those notices that do not
|
||||
pertain to any part of the Derivative Works, in at least one
|
||||
of the following places: within a NOTICE text file distributed
|
||||
as part of the Derivative Works; within the Source form or
|
||||
documentation, if provided along with the Derivative Works; or,
|
||||
within a display generated by the Derivative Works, if and
|
||||
wherever such third-party notices normally appear. The contents
|
||||
of the NOTICE file are for informational purposes only and
|
||||
do not modify the License. You may add Your own attribution
|
||||
notices within Derivative Works that You distribute, alongside
|
||||
or as an addendum to the NOTICE text from the Work, provided
|
||||
that such additional attribution notices cannot be construed
|
||||
as modifying the License.
|
||||
|
||||
You may add Your own copyright statement to Your modifications and
|
||||
may provide additional or different license terms and conditions
|
||||
for use, reproduction, or distribution of Your modifications, or
|
||||
for any such Derivative Works as a whole, provided Your use,
|
||||
reproduction, and distribution of the Work otherwise complies with
|
||||
the conditions stated in this License.
|
||||
|
||||
5. Submission of Contributions. Unless You explicitly state otherwise,
|
||||
any Contribution intentionally submitted for inclusion in the Work
|
||||
by You to the Licensor shall be under the terms and conditions of
|
||||
this License, without any additional terms or conditions.
|
||||
Notwithstanding the above, nothing herein shall supersede or modify
|
||||
the terms of any separate license agreement you may have executed
|
||||
with Licensor regarding such Contributions.
|
||||
|
||||
6. Trademarks. This License does not grant permission to use the trade
|
||||
names, trademarks, service marks, or product names of the Licensor,
|
||||
except as required for reasonable and customary use in describing the
|
||||
origin of the Work and reproducing the content of the NOTICE file.
|
||||
|
||||
7. Disclaimer of Warranty. Unless required by applicable law or
|
||||
agreed to in writing, Licensor provides the Work (and each
|
||||
Contributor provides its Contributions) on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
implied, including, without limitation, any warranties or conditions
|
||||
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
||||
PARTICULAR PURPOSE. You are solely responsible for determining the
|
||||
appropriateness of using or redistributing the Work and assume any
|
||||
risks associated with Your exercise of permissions under this License.
|
||||
|
||||
8. Limitation of Liability. In no event and under no legal theory,
|
||||
whether in tort (including negligence), contract, or otherwise,
|
||||
unless required by applicable law (such as deliberate and grossly
|
||||
negligent acts) or agreed to in writing, shall any Contributor be
|
||||
liable to You for damages, including any direct, indirect, special,
|
||||
incidental, or consequential damages of any character arising as a
|
||||
result of this License or out of the use or inability to use the
|
||||
Work (including but not limited to damages for loss of goodwill,
|
||||
work stoppage, computer failure or malfunction, or any and all
|
||||
other commercial damages or losses), even if such Contributor
|
||||
has been advised of the possibility of such damages.
|
||||
|
||||
9. Accepting Warranty or Additional Liability. While redistributing
|
||||
the Work or Derivative Works thereof, You may choose to offer,
|
||||
and charge a fee for, acceptance of support, warranty, indemnity,
|
||||
or other liability obligations and/or rights consistent with this
|
||||
License. However, in accepting such obligations, You may act only
|
||||
on Your own behalf and on Your sole responsibility, not on behalf
|
||||
of any other Contributor, and only if You agree to indemnify,
|
||||
defend, and hold each Contributor harmless for any liability
|
||||
incurred by, or claims asserted against, such Contributor by reason
|
||||
of your accepting any such warranty or additional liability.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
APPENDIX: How to apply the Apache License to your work.
|
||||
|
||||
To apply the Apache License to your work, attach the following
|
||||
boilerplate notice, with the fields enclosed by brackets "[]"
|
||||
replaced with your own identifying information. (Don't include
|
||||
the brackets!) The text should be enclosed in the appropriate
|
||||
comment syntax for the file format. We also recommend that a
|
||||
file or class name and description of purpose be included on the
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
You may obtain a copy of the License at
|
||||
|
||||
http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
Unless required by applicable law or agreed to in writing, software
|
||||
distributed under the License is distributed on an "AS IS" BASIS,
|
||||
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
See the License for the specific language governing permissions and
|
||||
limitations under the License.
|
||||
@@ -1,32 +0,0 @@
|
||||
Facebook SDK for iOS
|
||||
====================
|
||||
|
||||
This open-source library allows you to integrate Facebook into your iOS app.
|
||||
|
||||
Learn more about about the provided samples, documentation, integrating the SDK into your app, accessing source code, and more at https://developers.facebook.com/ios
|
||||
|
||||
NOTE: By default, the Facebook SDK for iOS is installed in ~/Documents/FacebookSDK
|
||||
|
||||
TRY IT OUT
|
||||
|
||||
1. Test your install; build and run the project at ~/Documents/FacebookSDK/Samples/HelloFacebookSample/HelloFacebookSample.xcodeproj
|
||||
|
||||
2. Check-out the tutorials available online at: https://developers.facebook.com/docs/getting-started/getting-started-with-the-ios-sdk
|
||||
|
||||
3. Start coding! Visit https://developers.facebook.com/ios for tutorials and reference documentation.
|
||||
|
||||
LICENSE
|
||||
|
||||
Except as otherwise noted, the Facebook SDK for iOS is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).
|
||||
|
||||
DEVELOPER TERMS
|
||||
|
||||
- By enabling Facebook integrations, including through this SDK, you can share information with Facebook, including information about people’s use of your app. Facebook will use information received in accordance with our Data Use Policy [https://www.facebook.com/about/privacy/], including to provide you with insights about the effectiveness of your ads and the use of your app. These integrations also enable us and our partners to serve ads on and off Facebook.
|
||||
|
||||
- You may limit your sharing of information with us by updating the Insights control in the developer tool [https://developers.facebook.com/apps/<app_id>/advanced].
|
||||
|
||||
- If you use a Facebook integration, including to share information with us, you agree and confirm that you have provided appropriate and sufficiently prominent notice to and obtained the appropriate consent from your users regarding such collection, use, and disclosure (including, at a minimum, through your privacy policy). You further agree that you will not share information with us about children under the age of 13.
|
||||
|
||||
- You agree to comply with all applicable laws and regulations and also agree to our Terms <https://www.facebook.com/policies/>, including our Platform Policies <https://developers.facebook.com/policy/>.and Advertising Guidelines, as applicable <https://www.facebook.com/ad_guidelines.php>.
|
||||
|
||||
By using the Facebook SDK for iOS you agree to these terms.
|
||||
@@ -1,32 +0,0 @@
|
||||
Facebook SDK for iOS
|
||||
====================
|
||||
|
||||
This open-source library allows you to integrate Facebook into your iOS app.
|
||||
|
||||
Learn more about about the provided samples, documentation, integrating the SDK into your app, accessing source code, and more at https://developers.facebook.com/ios
|
||||
|
||||
NOTE: By default, the Facebook SDK for iOS is installed in ~/Documents/FacebookSDK
|
||||
|
||||
TRY IT OUT
|
||||
|
||||
1. Test your install; build and run the project at ~/Documents/FacebookSDK/Samples/HelloFacebookSample/HelloFacebookSample.xcodeproj
|
||||
|
||||
2. Check-out the tutorials available online at: https://developers.facebook.com/docs/getting-started/getting-started-with-the-ios-sdk
|
||||
|
||||
3. Start coding! Visit https://developers.facebook.com/ios for tutorials and reference documentation.
|
||||
|
||||
LICENSE
|
||||
|
||||
Except as otherwise noted, the Facebook SDK for iOS is licensed under the Apache License, Version 2.0 (http://www.apache.org/licenses/LICENSE-2.0.html).
|
||||
|
||||
DEVELOPER TERMS
|
||||
|
||||
- By enabling Facebook integrations, including through this SDK, you can share information with Facebook, including information about people’s use of your app. Facebook will use information received in accordance with our Data Use Policy [https://www.facebook.com/about/privacy/], including to provide you with insights about the effectiveness of your ads and the use of your app. These integrations also enable us and our partners to serve ads on and off Facebook.
|
||||
|
||||
- You may limit your sharing of information with us by updating the Insights control in the developer tool [https://developers.facebook.com/apps/<app_id>/advanced].
|
||||
|
||||
- If you use a Facebook integration, including to share information with us, you agree and confirm that you have provided appropriate and sufficiently prominent notice to and obtained the appropriate consent from your users regarding such collection, use, and disclosure (including, at a minimum, through your privacy policy). You further agree that you will not share information with us about children under the age of 13.
|
||||
|
||||
- You agree to comply with all applicable laws and regulations and also agree to our Terms <https://www.facebook.com/policies/>, including our Platform Policies <https://developers.facebook.com/policy/>.and Advertising Guidelines, as applicable <https://www.facebook.com/ad_guidelines.php>.
|
||||
|
||||
By using the Facebook SDK for iOS you agree to these terms.
|
||||
@@ -1,343 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
85AFB4D7158F9C1D000AF7F5 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4D3158F9C1D000AF7F5 /* Icon-72.png */; };
|
||||
85AFB4D8158F9C1D000AF7F5 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4D4158F9C1D000AF7F5 /* Icon-72@2x.png */; };
|
||||
85AFB4D9158F9C1D000AF7F5 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4D5158F9C1D000AF7F5 /* Icon.png */; };
|
||||
85AFB4DA158F9C1D000AF7F5 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4D6158F9C1D000AF7F5 /* Icon@2x.png */; };
|
||||
85C69D7F1602B0AF008AD9A0 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69D7C1602B0AF008AD9A0 /* Default-568h@2x.png */; };
|
||||
85C69D801602B0AF008AD9A0 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69D7D1602B0AF008AD9A0 /* Default.png */; };
|
||||
85C69D811602B0AF008AD9A0 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69D7E1602B0AF008AD9A0 /* Default@2x.png */; };
|
||||
DD37EA8815ABA46B0015966B /* FacebookSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD37EA8715ABA46B0015966B /* FacebookSDK.framework */; };
|
||||
E2D6B81315413A570050835F /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2D6B81215413A570050835F /* UIKit.framework */; };
|
||||
E2D6B81515413A570050835F /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2D6B81415413A570050835F /* Foundation.framework */; };
|
||||
E2D6B81715413A570050835F /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2D6B81615413A570050835F /* CoreGraphics.framework */; };
|
||||
E2D6B81D15413A570050835F /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E2D6B81B15413A570050835F /* InfoPlist.strings */; };
|
||||
E2D6B81F15413A570050835F /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E2D6B81E15413A570050835F /* main.m */; };
|
||||
E2D6B82315413A570050835F /* FPAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E2D6B82215413A570050835F /* FPAppDelegate.m */; };
|
||||
E2D6B82615413A570050835F /* FPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E2D6B82515413A570050835F /* FPViewController.m */; };
|
||||
E2D6B82915413A570050835F /* FPViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2D6B82715413A570050835F /* FPViewController_iPhone.xib */; };
|
||||
E2D6B82C15413A570050835F /* FPViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2D6B82A15413A570050835F /* FPViewController_iPad.xib */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
85AFB4D3158F9C1D000AF7F5 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
|
||||
85AFB4D4158F9C1D000AF7F5 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72@2x.png"; sourceTree = "<group>"; };
|
||||
85AFB4D5158F9C1D000AF7F5 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
|
||||
85AFB4D6158F9C1D000AF7F5 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = "<group>"; };
|
||||
85C69D7C1602B0AF008AD9A0 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
|
||||
85C69D7D1602B0AF008AD9A0 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
|
||||
85C69D7E1602B0AF008AD9A0 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
|
||||
DD37EA8715ABA46B0015966B /* FacebookSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FacebookSDK.framework; path = ../../build/FacebookSDK.framework; sourceTree = "<group>"; };
|
||||
E2D6B80E15413A570050835F /* FriendPickerSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = FriendPickerSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E2D6B81215413A570050835F /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
E2D6B81415413A570050835F /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
E2D6B81615413A570050835F /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
E2D6B81A15413A570050835F /* FriendPickerSample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "FriendPickerSample-Info.plist"; sourceTree = "<group>"; };
|
||||
E2D6B81C15413A570050835F /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
E2D6B81E15413A570050835F /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
E2D6B82015413A570050835F /* FriendPickerSample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "FriendPickerSample-Prefix.pch"; sourceTree = "<group>"; };
|
||||
E2D6B82115413A570050835F /* FPAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FPAppDelegate.h; sourceTree = "<group>"; };
|
||||
E2D6B82215413A570050835F /* FPAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FPAppDelegate.m; sourceTree = "<group>"; };
|
||||
E2D6B82415413A570050835F /* FPViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FPViewController.h; sourceTree = "<group>"; };
|
||||
E2D6B82515413A570050835F /* FPViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = FPViewController.m; sourceTree = "<group>"; };
|
||||
E2D6B82815413A570050835F /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/FPViewController_iPhone.xib; sourceTree = "<group>"; };
|
||||
E2D6B82B15413A570050835F /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/FPViewController_iPad.xib; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
E2D6B80B15413A570050835F /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E2D6B81315413A570050835F /* UIKit.framework in Frameworks */,
|
||||
E2D6B81515413A570050835F /* Foundation.framework in Frameworks */,
|
||||
E2D6B81715413A570050835F /* CoreGraphics.framework in Frameworks */,
|
||||
DD37EA8815ABA46B0015966B /* FacebookSDK.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
E2D6B80315413A560050835F = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E2D6B81815413A570050835F /* FriendPickerSample */,
|
||||
E2D6B81115413A570050835F /* Frameworks */,
|
||||
E2D6B80F15413A570050835F /* Products */,
|
||||
);
|
||||
indentWidth = 4;
|
||||
sourceTree = "<group>";
|
||||
tabWidth = 4;
|
||||
};
|
||||
E2D6B80F15413A570050835F /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E2D6B80E15413A570050835F /* FriendPickerSample.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E2D6B81115413A570050835F /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DD37EA8715ABA46B0015966B /* FacebookSDK.framework */,
|
||||
E2D6B81215413A570050835F /* UIKit.framework */,
|
||||
E2D6B81415413A570050835F /* Foundation.framework */,
|
||||
E2D6B81615413A570050835F /* CoreGraphics.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E2D6B81815413A570050835F /* FriendPickerSample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E2D6B82115413A570050835F /* FPAppDelegate.h */,
|
||||
E2D6B82215413A570050835F /* FPAppDelegate.m */,
|
||||
E2D6B82415413A570050835F /* FPViewController.h */,
|
||||
E2D6B82515413A570050835F /* FPViewController.m */,
|
||||
E2D6B82715413A570050835F /* FPViewController_iPhone.xib */,
|
||||
E2D6B82A15413A570050835F /* FPViewController_iPad.xib */,
|
||||
E2D6B81915413A570050835F /* Supporting Files */,
|
||||
);
|
||||
path = FriendPickerSample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E2D6B81915413A570050835F /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
85C69D7C1602B0AF008AD9A0 /* Default-568h@2x.png */,
|
||||
85C69D7D1602B0AF008AD9A0 /* Default.png */,
|
||||
85C69D7E1602B0AF008AD9A0 /* Default@2x.png */,
|
||||
85AFB4D3158F9C1D000AF7F5 /* Icon-72.png */,
|
||||
85AFB4D4158F9C1D000AF7F5 /* Icon-72@2x.png */,
|
||||
85AFB4D5158F9C1D000AF7F5 /* Icon.png */,
|
||||
85AFB4D6158F9C1D000AF7F5 /* Icon@2x.png */,
|
||||
E2D6B81A15413A570050835F /* FriendPickerSample-Info.plist */,
|
||||
E2D6B81B15413A570050835F /* InfoPlist.strings */,
|
||||
E2D6B81E15413A570050835F /* main.m */,
|
||||
E2D6B82015413A570050835F /* FriendPickerSample-Prefix.pch */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
E2D6B80D15413A570050835F /* FriendPickerSample */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = E2D6B82F15413A570050835F /* Build configuration list for PBXNativeTarget "FriendPickerSample" */;
|
||||
buildPhases = (
|
||||
E2D6B80A15413A570050835F /* Sources */,
|
||||
E2D6B80B15413A570050835F /* Frameworks */,
|
||||
E2D6B80C15413A570050835F /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = FriendPickerSample;
|
||||
productName = FriendPickerSample;
|
||||
productReference = E2D6B80E15413A570050835F /* FriendPickerSample.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
E2D6B80515413A560050835F /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0430;
|
||||
};
|
||||
buildConfigurationList = E2D6B80815413A560050835F /* Build configuration list for PBXProject "FriendPickerSample" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
he,
|
||||
);
|
||||
mainGroup = E2D6B80315413A560050835F;
|
||||
productRefGroup = E2D6B80F15413A570050835F /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
E2D6B80D15413A570050835F /* FriendPickerSample */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
E2D6B80C15413A570050835F /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E2D6B81D15413A570050835F /* InfoPlist.strings in Resources */,
|
||||
E2D6B82915413A570050835F /* FPViewController_iPhone.xib in Resources */,
|
||||
E2D6B82C15413A570050835F /* FPViewController_iPad.xib in Resources */,
|
||||
85AFB4D7158F9C1D000AF7F5 /* Icon-72.png in Resources */,
|
||||
85AFB4D8158F9C1D000AF7F5 /* Icon-72@2x.png in Resources */,
|
||||
85AFB4D9158F9C1D000AF7F5 /* Icon.png in Resources */,
|
||||
85AFB4DA158F9C1D000AF7F5 /* Icon@2x.png in Resources */,
|
||||
85C69D7F1602B0AF008AD9A0 /* Default-568h@2x.png in Resources */,
|
||||
85C69D801602B0AF008AD9A0 /* Default.png in Resources */,
|
||||
85C69D811602B0AF008AD9A0 /* Default@2x.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
E2D6B80A15413A570050835F /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E2D6B81F15413A570050835F /* main.m in Sources */,
|
||||
E2D6B82315413A570050835F /* FPAppDelegate.m in Sources */,
|
||||
E2D6B82615413A570050835F /* FPViewController.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
E2D6B81B15413A570050835F /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
E2D6B81C15413A570050835F /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E2D6B82715413A570050835F /* FPViewController_iPhone.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
E2D6B82815413A570050835F /* en */,
|
||||
);
|
||||
name = FPViewController_iPhone.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E2D6B82A15413A570050835F /* FPViewController_iPad.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
E2D6B82B15413A570050835F /* en */,
|
||||
);
|
||||
name = FPViewController_iPad.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
E2D6B82D15413A570050835F /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
E2D6B82E15413A570050835F /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 4.3;
|
||||
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
E2D6B83015413A570050835F /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/../../build\"",
|
||||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "FriendPickerSample/FriendPickerSample-Prefix.pch";
|
||||
INFOPLIST_FILE = "FriendPickerSample/FriendPickerSample-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
E2D6B83115413A570050835F /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/../../build\"",
|
||||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "FriendPickerSample/FriendPickerSample-Prefix.pch";
|
||||
INFOPLIST_FILE = "FriendPickerSample/FriendPickerSample-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
E2D6B80815413A560050835F /* Build configuration list for PBXProject "FriendPickerSample" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
E2D6B82D15413A570050835F /* Debug */,
|
||||
E2D6B82E15413A570050835F /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Debug;
|
||||
};
|
||||
E2D6B82F15413A570050835F /* Build configuration list for PBXNativeTarget "FriendPickerSample" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
E2D6B83015413A570050835F /* Debug */,
|
||||
E2D6B83115413A570050835F /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Debug;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = E2D6B80515413A560050835F /* Project object */;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 16 KiB |
@@ -1,35 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <FacebookSDK/FacebookSDK.h>
|
||||
|
||||
// Friend Picker sample application
|
||||
//
|
||||
// The purpose of this sample application is to provide a very simple
|
||||
// example of the FBFriendPickerViewController, without other bells and
|
||||
// whistles to destract from the widget. This is a single-view application
|
||||
// with simplistic authentication with Facebook. The view-controller for
|
||||
// the applicaiton (FPViewController) inherits FBFriendPicerViewController.
|
||||
|
||||
@class FPViewController;
|
||||
|
||||
@interface FPAppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) FPViewController *rootViewController;
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
|
||||
@end
|
||||
@@ -1,90 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "FPAppDelegate.h"
|
||||
#import "FPViewController.h"
|
||||
|
||||
@implementation FPAppDelegate
|
||||
|
||||
@synthesize window = _window;
|
||||
@synthesize rootViewController = _rootViewController;
|
||||
|
||||
// FBSample logic
|
||||
// In the login workflow, the Facebook native application, or Safari will transition back to
|
||||
// this applicaiton via a url following the scheme fb[app id]://; the call to handleOpenURL
|
||||
// below captures the token, in the case of success, on behalf of the FBSession object
|
||||
- (BOOL)application:(UIApplication *)application
|
||||
openURL:(NSURL *)url
|
||||
sourceApplication:(NSString *)sourceApplication
|
||||
annotation:(id)annotation {
|
||||
return [FBAppCall handleOpenURL:url sourceApplication:sourceApplication];
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||
[FBAppEvents activateApp];
|
||||
[FBAppCall handleDidBecomeActive];
|
||||
}
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
// If you have not added the -ObjC linker flag, you may need to uncomment the following line because
|
||||
// Nib files require the type to have been loaded before they can do the wireup successfully.
|
||||
// http://stackoverflow.com/questions/1725881/unknown-class-myclass-in-interface-builder-file-error-at-runtime
|
||||
// [FBFriendPickerViewController class];
|
||||
|
||||
// Override point for customization after application launch.
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
|
||||
self.rootViewController = [[FPViewController alloc] initWithNibName:@"FPViewController_iPhone" bundle:nil];
|
||||
} else {
|
||||
self.rootViewController = [[FPViewController alloc] initWithNibName:@"FPViewController_iPad" bundle:nil];
|
||||
}
|
||||
#ifdef __IPHONE_7_0
|
||||
#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0
|
||||
if ([self.rootViewController respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {
|
||||
self.rootViewController.edgesForExtendedLayout &= ~UIRectEdgeTop;
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
self.rootViewController.navigationItem.title = @"Friend Picker";
|
||||
|
||||
// Set up a UINavigationController as the basis of this app, with the nib generated viewController
|
||||
// as the initial view.
|
||||
UINavigationController *navigationController =
|
||||
[[UINavigationController alloc] initWithRootViewController:self.rootViewController];
|
||||
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
self.window.rootViewController = navigationController;
|
||||
[self.window makeKeyAndVisible];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (NSUInteger)supportedInterfaceOrientations{
|
||||
return UIInterfaceOrientationMaskAllButUpsideDown;
|
||||
}
|
||||
|
||||
// FBSample logic
|
||||
// It is important to close any FBSession object that is no longer useful
|
||||
- (void)applicationWillTerminate:(UIApplication *)application {
|
||||
// Close the session before quitting
|
||||
// this is a good idea because things may be hanging off the session, that need
|
||||
// releasing (completion block, etc.) and other components in the app may be awaiting
|
||||
// close notification in order to do cleanup
|
||||
[FBSession.activeSession close];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,23 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface FPViewController : UIViewController<FBFriendPickerDelegate>
|
||||
|
||||
- (IBAction)pickFriendsButtonClick:(id)sender;
|
||||
|
||||
@end
|
||||
@@ -1,122 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "FPAppDelegate.h"
|
||||
#import "FPViewController.h"
|
||||
|
||||
// FBSample logic
|
||||
// We need to handle some of the UX events related to friend selection, and so we declare
|
||||
// that we implement the FBFriendPickerDelegate here; the delegate lets us filter the view
|
||||
// as well as handle selection events
|
||||
@interface FPViewController ()
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UITextView *selectedFriendsView;
|
||||
@property (retain, nonatomic) FBFriendPickerViewController *friendPickerController;
|
||||
|
||||
- (void)fillTextBoxAndDismiss:(NSString *)text;
|
||||
|
||||
@end
|
||||
|
||||
@implementation FPViewController
|
||||
|
||||
@synthesize selectedFriendsView = _friendResultText;
|
||||
@synthesize friendPickerController = _friendPickerController;
|
||||
|
||||
#pragma mark View lifecycle
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
}
|
||||
|
||||
- (void)viewDidUnload {
|
||||
self.selectedFriendsView = nil;
|
||||
self.friendPickerController = nil;
|
||||
|
||||
[super viewDidUnload];
|
||||
}
|
||||
|
||||
#pragma mark UI handlers
|
||||
|
||||
- (IBAction)pickFriendsButtonClick:(id)sender {
|
||||
// FBSample logic
|
||||
// if the session is open, then load the data for our view controller
|
||||
if (!FBSession.activeSession.isOpen) {
|
||||
// if the session is closed, then we open it here, and establish a handler for state changes
|
||||
[FBSession openActiveSessionWithReadPermissions:nil
|
||||
allowLoginUI:YES
|
||||
completionHandler:^(FBSession *session,
|
||||
FBSessionState state,
|
||||
NSError *error) {
|
||||
if (error) {
|
||||
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Error"
|
||||
message:error.localizedDescription
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
otherButtonTitles:nil];
|
||||
[alertView show];
|
||||
} else if (session.isOpen) {
|
||||
[self pickFriendsButtonClick:sender];
|
||||
}
|
||||
}];
|
||||
return;
|
||||
}
|
||||
|
||||
if (self.friendPickerController == nil) {
|
||||
// Create friend picker, and get data loaded into it.
|
||||
self.friendPickerController = [[FBFriendPickerViewController alloc] init];
|
||||
self.friendPickerController.title = @"Pick Friends";
|
||||
self.friendPickerController.delegate = self;
|
||||
}
|
||||
|
||||
[self.friendPickerController loadData];
|
||||
[self.friendPickerController clearSelection];
|
||||
|
||||
[self presentViewController:self.friendPickerController animated:YES completion:nil];
|
||||
}
|
||||
|
||||
- (void)facebookViewControllerDoneWasPressed:(id)sender {
|
||||
NSMutableString *text = [[NSMutableString alloc] init];
|
||||
|
||||
// we pick up the users from the selection, and create a string that we use to update the text view
|
||||
// at the bottom of the display; note that self.selection is a property inherited from our base class
|
||||
for (id<FBGraphUser> user in self.friendPickerController.selection) {
|
||||
if ([text length]) {
|
||||
[text appendString:@", "];
|
||||
}
|
||||
[text appendString:user.name];
|
||||
}
|
||||
|
||||
[self fillTextBoxAndDismiss:text.length > 0 ? text : @"<None>"];
|
||||
}
|
||||
|
||||
- (void)facebookViewControllerCancelWasPressed:(id)sender {
|
||||
[self fillTextBoxAndDismiss:@"<Cancelled>"];
|
||||
}
|
||||
|
||||
- (void)fillTextBoxAndDismiss:(NSString *)text {
|
||||
self.selectedFriendsView.text = text;
|
||||
|
||||
[self dismissModalViewControllerAnimated:YES];
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)orientation
|
||||
{
|
||||
return YES;
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@end
|
||||
@@ -1,85 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon.png</string>
|
||||
<string>Icon@2x.png</string>
|
||||
<string>Icon-72.png</string>
|
||||
<string>Icon-72@2x.png</string>
|
||||
</array>
|
||||
<key>CFBundleIcons</key>
|
||||
<dict>
|
||||
<key>CFBundlePrimaryIcon</key>
|
||||
<dict>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon.png</string>
|
||||
<string>Icon@2x.png</string>
|
||||
<string>Icon-72.png</string>
|
||||
<string>Icon-72@2x.png</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.facebook.sdk.samples.friendpicker</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>fb370546396320150</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>FacebookAppID</key>
|
||||
<string>370546396320150</string>
|
||||
<key>FacebookDisplayName</key>
|
||||
<string>FriendPickerSample</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>CFBundleLocalizations</key>
|
||||
<array>
|
||||
<string>en</string>
|
||||
<string>ru</string>
|
||||
<string>zh</string>
|
||||
<string>ja</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,14 +0,0 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'FriendPickerSample' target in the 'FriendPickerSample' project
|
||||
//
|
||||
|
||||
#import <Availability.h>
|
||||
|
||||
#ifndef __IPHONE_4_0
|
||||
#warning "This project uses features only available in iOS SDK 4.0 and later."
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 25 KiB |
|
Before Width: | Height: | Size: 9.9 KiB |
|
Before Width: | Height: | Size: 21 KiB |
@@ -1,289 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1296</int>
|
||||
<string key="IBDocument.SystemVersion">11E53</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2182</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.47</string>
|
||||
<string key="IBDocument.HIToolboxVersion">569.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">1181</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>IBUITextView</string>
|
||||
<string>IBUIButton</string>
|
||||
<string>IBUIView</string>
|
||||
<string>IBUILabel</string>
|
||||
<string>IBProxyObject</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</array>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<object class="IBProxyObject" id="841351856">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="606714003">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="766721923">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="IBUITextView" id="35983996">
|
||||
<reference key="NSNextResponder" ref="766721923"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 218}, {728, 128}}</string>
|
||||
<reference key="NSSuperview" ref="766721923"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:640</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MSAxIDEAA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<bool key="IBUIMultipleTouchEnabled">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<bool key="IBUIShowsHorizontalScrollIndicator">NO</bool>
|
||||
<bool key="IBUIEditable">NO</bool>
|
||||
<string key="IBUIText"/>
|
||||
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
|
||||
<int key="IBUIAutocapitalizationType">2</int>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription">
|
||||
<int key="type">1</int>
|
||||
<double key="pointSize">14</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">14</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUIButton" id="659877635">
|
||||
<reference key="NSNextResponder" ref="766721923"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{273, 101}, {223, 37}}</string>
|
||||
<reference key="NSSuperview" ref="766721923"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="339297849"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<string key="IBUINormalTitle">Pick Friends</string>
|
||||
<object class="NSColor" key="IBUIHighlightedTitleColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleShadowColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription">
|
||||
<int key="type">2</int>
|
||||
<double key="pointSize">15</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica-Bold</string>
|
||||
<double key="NSSize">15</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUILabel" id="339297849">
|
||||
<reference key="NSNextResponder" ref="766721923"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 189}, {118, 21}}</string>
|
||||
<reference key="NSSuperview" ref="766721923"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="35983996"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<string key="IBUIText">Friends Picked:</string>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">0</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription">
|
||||
<int key="type">1</int>
|
||||
<double key="pointSize">17</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">17</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{0, 20}, {768, 1004}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="659877635"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
|
||||
</object>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
|
||||
<int key="IBUIStatusBarStyle">2</int>
|
||||
</object>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<array class="NSMutableArray" key="connectionRecords">
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="766721923"/>
|
||||
</object>
|
||||
<int key="connectionID">3</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">selectedFriendsView</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="35983996"/>
|
||||
</object>
|
||||
<int key="connectionID">28</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">pickFriendsButtonClick:</string>
|
||||
<reference key="source" ref="659877635"/>
|
||||
<reference key="destination" ref="841351856"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<int key="connectionID">38</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<array key="object" id="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="841351856"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="606714003"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">2</int>
|
||||
<reference key="object" ref="766721923"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="35983996"/>
|
||||
<reference ref="659877635"/>
|
||||
<reference ref="339297849"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">5</int>
|
||||
<reference key="object" ref="35983996"/>
|
||||
<reference key="parent" ref="766721923"/>
|
||||
<string key="objectName">results</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">37</int>
|
||||
<reference key="object" ref="659877635"/>
|
||||
<reference key="parent" ref="766721923"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">39</int>
|
||||
<reference key="object" ref="339297849"/>
|
||||
<reference key="parent" ref="766721923"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
<string key="-1.CustomClassName">FPViewController</string>
|
||||
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="-2.CustomClassName">UIResponder</string>
|
||||
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="37.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="39.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">39</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">FPViewController</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<object class="NSMutableDictionary" key="actions">
|
||||
<string key="NS.key.0">pickFriendsButtonClick:</string>
|
||||
<string key="NS.object.0">id</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="actionInfosByName">
|
||||
<string key="NS.key.0">pickFriendsButtonClick:</string>
|
||||
<object class="IBActionInfo" key="NS.object.0">
|
||||
<string key="name">pickFriendsButtonClick:</string>
|
||||
<string key="candidateClassName">id</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="outlets">
|
||||
<string key="NS.key.0">selectedFriendsView</string>
|
||||
<string key="NS.object.0">UITextView</string>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<string key="NS.key.0">selectedFriendsView</string>
|
||||
<object class="IBToOneOutletInfo" key="NS.object.0">
|
||||
<string key="name">selectedFriendsView</string>
|
||||
<string key="candidateClassName">UITextView</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/FPViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<real value="1296" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">1181</string>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -1,253 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1536</int>
|
||||
<string key="IBDocument.SystemVersion">11G63</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2844</string>
|
||||
<string key="IBDocument.AppKitVersion">1138.51</string>
|
||||
<string key="IBDocument.HIToolboxVersion">569.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">1930</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUIButton</string>
|
||||
<string>IBUILabel</string>
|
||||
<string>IBUITextView</string>
|
||||
<string>IBUIView</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</array>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="843779117">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="774585933">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="IBUITextView" id="148239609">
|
||||
<reference key="NSNextResponder" ref="774585933"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 130}, {280, 84}}</string>
|
||||
<reference key="NSSuperview" ref="774585933"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:639</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MSAxIDEAA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<bool key="IBUIMultipleTouchEnabled">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBUIEditable">NO</bool>
|
||||
<string key="IBUIText"/>
|
||||
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
|
||||
<int key="IBUIAutocapitalizationType">2</int>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription">
|
||||
<int key="type">1</int>
|
||||
<double key="pointSize">14</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">14</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUIButton" id="180895893">
|
||||
<reference key="NSNextResponder" ref="774585933"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{86, 20}, {148, 37}}</string>
|
||||
<reference key="NSSuperview" ref="774585933"/>
|
||||
<reference key="NSNextKeyView" ref="351918352"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<string key="IBUINormalTitle">Pick Friends</string>
|
||||
<object class="NSColor" key="IBUIHighlightedTitleColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleShadowColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription">
|
||||
<int key="type">2</int>
|
||||
<double key="pointSize">15</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica-Bold</string>
|
||||
<double key="NSSize">15</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUILabel" id="351918352">
|
||||
<reference key="NSNextResponder" ref="774585933"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 101}, {118, 21}}</string>
|
||||
<reference key="NSSuperview" ref="774585933"/>
|
||||
<reference key="NSNextKeyView" ref="148239609"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText">Friends Picked:</string>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
<string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">0</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription">
|
||||
<int key="type">1</int>
|
||||
<double key="pointSize">17</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">17</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSNextKeyView" ref="180895893"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC43NQA</bytes>
|
||||
<object class="NSColorSpace" key="NSCustomColorSpace">
|
||||
<int key="NSID">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<array class="NSMutableArray" key="connectionRecords">
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="774585933"/>
|
||||
</object>
|
||||
<int key="connectionID">7</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">selectedFriendsView</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="148239609"/>
|
||||
</object>
|
||||
<int key="connectionID">34</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">pickFriendsButtonClick:</string>
|
||||
<reference key="source" ref="180895893"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<int key="connectionID">49</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<array key="object" id="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="843779117"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
<reference key="object" ref="774585933"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="180895893"/>
|
||||
<reference ref="148239609"/>
|
||||
<reference ref="351918352"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">11</int>
|
||||
<reference key="object" ref="148239609"/>
|
||||
<reference key="parent" ref="774585933"/>
|
||||
<string key="objectName">results</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">46</int>
|
||||
<reference key="object" ref="180895893"/>
|
||||
<reference key="parent" ref="774585933"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">48</int>
|
||||
<reference key="object" ref="351918352"/>
|
||||
<reference key="parent" ref="774585933"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
<string key="-1.CustomClassName">FPViewController</string>
|
||||
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="-2.CustomClassName">UIResponder</string>
|
||||
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="11.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="46.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="48.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">49</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes"/>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<real value="1536" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">1930</string>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -1,2 +0,0 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "FPAppDelegate.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([FPAppDelegate class]));
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
Friend Picker sample
|
||||
|
||||
Demonstrates how to use a FBFriendPickerViewController in the Facebook SDK for iOS.
|
||||
|
||||
Using the Sample
|
||||
Install the Facebook SDK for iOS.
|
||||
Launch the FriendPickerSample project using Xcode from the <Facebook SDK>/samples/FriendPickerSample directory.
|
||||
@@ -1,345 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
85AFB4FF158F9D32000AF7F5 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4FB158F9D32000AF7F5 /* Icon-72.png */; };
|
||||
85AFB500158F9D32000AF7F5 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4FC158F9D32000AF7F5 /* Icon-72@2x.png */; };
|
||||
85AFB501158F9D32000AF7F5 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4FD158F9D32000AF7F5 /* Icon.png */; };
|
||||
85AFB502158F9D32000AF7F5 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB4FE158F9D32000AF7F5 /* Icon@2x.png */; };
|
||||
85C69D691602B06E008AD9A0 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69D661602B06E008AD9A0 /* Default-568h@2x.png */; };
|
||||
85C69D6A1602B06E008AD9A0 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69D671602B06E008AD9A0 /* Default.png */; };
|
||||
85C69D6B1602B06E008AD9A0 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69D681602B06E008AD9A0 /* Default@2x.png */; };
|
||||
DDA290AD15ABA96200F533F9 /* FacebookSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DDA290AC15ABA96200F533F9 /* FacebookSDK.framework */; };
|
||||
E2511742152BB6FE00CB342A /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2511741152BB6FE00CB342A /* UIKit.framework */; };
|
||||
E2511744152BB6FE00CB342A /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2511743152BB6FE00CB342A /* Foundation.framework */; };
|
||||
E2511746152BB6FE00CB342A /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = E2511745152BB6FE00CB342A /* CoreGraphics.framework */; };
|
||||
E251174C152BB6FE00CB342A /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = E251174A152BB6FE00CB342A /* InfoPlist.strings */; };
|
||||
E251174E152BB6FE00CB342A /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = E251174D152BB6FE00CB342A /* main.m */; };
|
||||
E2511752152BB6FE00CB342A /* GraphApiAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = E2511751152BB6FE00CB342A /* GraphApiAppDelegate.m */; };
|
||||
E2511755152BB6FE00CB342A /* GraphApiViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = E2511754152BB6FE00CB342A /* GraphApiViewController.m */; };
|
||||
E2511758152BB6FE00CB342A /* GraphApiViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2511756152BB6FE00CB342A /* GraphApiViewController_iPhone.xib */; };
|
||||
E251175B152BB6FE00CB342A /* GraphApiViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = E2511759152BB6FE00CB342A /* GraphApiViewController_iPad.xib */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
85AFB4FB158F9D32000AF7F5 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
|
||||
85AFB4FC158F9D32000AF7F5 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72@2x.png"; sourceTree = "<group>"; };
|
||||
85AFB4FD158F9D32000AF7F5 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
|
||||
85AFB4FE158F9D32000AF7F5 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = "<group>"; };
|
||||
85C69D661602B06E008AD9A0 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
|
||||
85C69D671602B06E008AD9A0 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
|
||||
85C69D681602B06E008AD9A0 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
|
||||
DDA290AC15ABA96200F533F9 /* FacebookSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FacebookSDK.framework; path = ../../build/FacebookSDK.framework; sourceTree = "<group>"; };
|
||||
E251173D152BB6FE00CB342A /* GraphApiSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = GraphApiSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
E2511741152BB6FE00CB342A /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
E2511743152BB6FE00CB342A /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
E2511745152BB6FE00CB342A /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
E2511749152BB6FE00CB342A /* GraphApiSample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "GraphApiSample-Info.plist"; sourceTree = "<group>"; };
|
||||
E251174B152BB6FE00CB342A /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
E251174D152BB6FE00CB342A /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
E251174F152BB6FE00CB342A /* GraphApiSample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "GraphApiSample-Prefix.pch"; sourceTree = "<group>"; };
|
||||
E2511750152BB6FE00CB342A /* GraphApiAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GraphApiAppDelegate.h; sourceTree = "<group>"; };
|
||||
E2511751152BB6FE00CB342A /* GraphApiAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GraphApiAppDelegate.m; sourceTree = "<group>"; };
|
||||
E2511753152BB6FE00CB342A /* GraphApiViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = GraphApiViewController.h; sourceTree = "<group>"; };
|
||||
E2511754152BB6FE00CB342A /* GraphApiViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = GraphApiViewController.m; sourceTree = "<group>"; };
|
||||
E2511757152BB6FE00CB342A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/GraphApiViewController_iPhone.xib; sourceTree = "<group>"; };
|
||||
E251175A152BB6FE00CB342A /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/GraphApiViewController_iPad.xib; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
E251173A152BB6FE00CB342A /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E2511742152BB6FE00CB342A /* UIKit.framework in Frameworks */,
|
||||
E2511744152BB6FE00CB342A /* Foundation.framework in Frameworks */,
|
||||
E2511746152BB6FE00CB342A /* CoreGraphics.framework in Frameworks */,
|
||||
DDA290AD15ABA96200F533F9 /* FacebookSDK.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
E2511732152BB6FE00CB342A = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E2511747152BB6FE00CB342A /* GraphApiSample */,
|
||||
E2511740152BB6FE00CB342A /* Frameworks */,
|
||||
E251173E152BB6FE00CB342A /* Products */,
|
||||
);
|
||||
indentWidth = 4;
|
||||
sourceTree = "<group>";
|
||||
tabWidth = 4;
|
||||
};
|
||||
E251173E152BB6FE00CB342A /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E251173D152BB6FE00CB342A /* GraphApiSample.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E2511740152BB6FE00CB342A /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DDA290AC15ABA96200F533F9 /* FacebookSDK.framework */,
|
||||
E2511741152BB6FE00CB342A /* UIKit.framework */,
|
||||
E2511743152BB6FE00CB342A /* Foundation.framework */,
|
||||
E2511745152BB6FE00CB342A /* CoreGraphics.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E2511747152BB6FE00CB342A /* GraphApiSample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
E2511750152BB6FE00CB342A /* GraphApiAppDelegate.h */,
|
||||
E2511751152BB6FE00CB342A /* GraphApiAppDelegate.m */,
|
||||
E2511753152BB6FE00CB342A /* GraphApiViewController.h */,
|
||||
E2511754152BB6FE00CB342A /* GraphApiViewController.m */,
|
||||
E2511756152BB6FE00CB342A /* GraphApiViewController_iPhone.xib */,
|
||||
E2511759152BB6FE00CB342A /* GraphApiViewController_iPad.xib */,
|
||||
E2511748152BB6FE00CB342A /* Supporting Files */,
|
||||
);
|
||||
path = GraphApiSample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E2511748152BB6FE00CB342A /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
85C69D661602B06E008AD9A0 /* Default-568h@2x.png */,
|
||||
85C69D671602B06E008AD9A0 /* Default.png */,
|
||||
85C69D681602B06E008AD9A0 /* Default@2x.png */,
|
||||
85AFB4FB158F9D32000AF7F5 /* Icon-72.png */,
|
||||
85AFB4FC158F9D32000AF7F5 /* Icon-72@2x.png */,
|
||||
85AFB4FD158F9D32000AF7F5 /* Icon.png */,
|
||||
85AFB4FE158F9D32000AF7F5 /* Icon@2x.png */,
|
||||
E2511749152BB6FE00CB342A /* GraphApiSample-Info.plist */,
|
||||
E251174A152BB6FE00CB342A /* InfoPlist.strings */,
|
||||
E251174D152BB6FE00CB342A /* main.m */,
|
||||
E251174F152BB6FE00CB342A /* GraphApiSample-Prefix.pch */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
E251173C152BB6FE00CB342A /* GraphApiSample */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = E251175E152BB6FE00CB342A /* Build configuration list for PBXNativeTarget "GraphApiSample" */;
|
||||
buildPhases = (
|
||||
E2511739152BB6FE00CB342A /* Sources */,
|
||||
E251173A152BB6FE00CB342A /* Frameworks */,
|
||||
E251173B152BB6FE00CB342A /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = GraphApiSample;
|
||||
productName = GraphApiSample;
|
||||
productReference = E251173D152BB6FE00CB342A /* GraphApiSample.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
E2511734152BB6FE00CB342A /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0420;
|
||||
};
|
||||
buildConfigurationList = E2511737152BB6FE00CB342A /* Build configuration list for PBXProject "GraphApiSample" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
he,
|
||||
);
|
||||
mainGroup = E2511732152BB6FE00CB342A;
|
||||
productRefGroup = E251173E152BB6FE00CB342A /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
E251173C152BB6FE00CB342A /* GraphApiSample */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
E251173B152BB6FE00CB342A /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E251174C152BB6FE00CB342A /* InfoPlist.strings in Resources */,
|
||||
E2511758152BB6FE00CB342A /* GraphApiViewController_iPhone.xib in Resources */,
|
||||
E251175B152BB6FE00CB342A /* GraphApiViewController_iPad.xib in Resources */,
|
||||
85AFB4FF158F9D32000AF7F5 /* Icon-72.png in Resources */,
|
||||
85AFB500158F9D32000AF7F5 /* Icon-72@2x.png in Resources */,
|
||||
85AFB501158F9D32000AF7F5 /* Icon.png in Resources */,
|
||||
85AFB502158F9D32000AF7F5 /* Icon@2x.png in Resources */,
|
||||
85C69D691602B06E008AD9A0 /* Default-568h@2x.png in Resources */,
|
||||
85C69D6A1602B06E008AD9A0 /* Default.png in Resources */,
|
||||
85C69D6B1602B06E008AD9A0 /* Default@2x.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
E2511739152BB6FE00CB342A /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
E251174E152BB6FE00CB342A /* main.m in Sources */,
|
||||
E2511752152BB6FE00CB342A /* GraphApiAppDelegate.m in Sources */,
|
||||
E2511755152BB6FE00CB342A /* GraphApiViewController.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
E251174A152BB6FE00CB342A /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
E251174B152BB6FE00CB342A /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E2511756152BB6FE00CB342A /* GraphApiViewController_iPhone.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
E2511757152BB6FE00CB342A /* en */,
|
||||
);
|
||||
name = GraphApiViewController_iPhone.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
E2511759152BB6FE00CB342A /* GraphApiViewController_iPad.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
E251175A152BB6FE00CB342A /* en */,
|
||||
);
|
||||
name = GraphApiViewController_iPad.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
E251175C152BB6FE00CB342A /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
E251175D152BB6FE00CB342A /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
E251175F152BB6FE00CB342A /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_OBJCPP_ARC_ABI = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/../../build\"",
|
||||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "GraphApiSample/GraphApiSample-Prefix.pch";
|
||||
INFOPLIST_FILE = "$(SRCROOT)/GraphApiSample/GraphApiSample-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = GraphApiSample;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
E2511760152BB6FE00CB342A /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_OBJCPP_ARC_ABI = YES;
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/../../build\"",
|
||||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "GraphApiSample/GraphApiSample-Prefix.pch";
|
||||
INFOPLIST_FILE = "$(SRCROOT)/GraphApiSample/GraphApiSample-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = GraphApiSample;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
E2511737152BB6FE00CB342A /* Build configuration list for PBXProject "GraphApiSample" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
E251175C152BB6FE00CB342A /* Debug */,
|
||||
E251175D152BB6FE00CB342A /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
E251175E152BB6FE00CB342A /* Build configuration list for PBXNativeTarget "GraphApiSample" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
E251175F152BB6FE00CB342A /* Debug */,
|
||||
E2511760152BB6FE00CB342A /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = E2511734152BB6FE00CB342A /* Project object */;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 16 KiB |
@@ -1,33 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
// Just Request sample application
|
||||
//
|
||||
// The purpose of this sample application is to provide an example of
|
||||
// how to request data and entities from Facebook. The goal of the sample
|
||||
// is to show how to use the FBRequest and FBSession classes for this purpose,
|
||||
// with minimal additional sample functionality to distract from the core topic.
|
||||
|
||||
@class GraphApiViewController;
|
||||
|
||||
@interface GraphApiAppDelegate : UIResponder <UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
@property (strong, nonatomic) GraphApiViewController *viewController;
|
||||
|
||||
@end
|
||||
@@ -1,66 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <FacebookSDK/FacebookSDK.h>
|
||||
#import "GraphApiAppDelegate.h"
|
||||
#import "GraphApiViewController.h"
|
||||
|
||||
@implementation GraphApiAppDelegate
|
||||
|
||||
@synthesize window = _window;
|
||||
@synthesize viewController = _viewController;
|
||||
|
||||
#pragma mark Template generated code
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
// Override point for customization after application launch.
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
|
||||
self.viewController = [[GraphApiViewController alloc] initWithNibName:@"GraphApiViewController_iPhone" bundle:nil];
|
||||
} else {
|
||||
self.viewController = [[GraphApiViewController alloc] initWithNibName:@"GraphApiViewController_iPad" bundle:nil];
|
||||
}
|
||||
self.window.rootViewController = self.viewController;
|
||||
[self.window makeKeyAndVisible];
|
||||
return YES;
|
||||
}
|
||||
|
||||
// FBSample logic
|
||||
// In the login workflow, the Facebook native application, or Safari will transition back to
|
||||
// this applicaiton via a url following the scheme fb[app id]://; the call to handleOpenURL
|
||||
// below captures the token, in the case of success, on behalf of the FBSession object
|
||||
- (BOOL)application:(UIApplication *)application
|
||||
openURL:(NSURL *)url
|
||||
sourceApplication:(NSString *)sourceApplication
|
||||
annotation:(id)annotation {
|
||||
return [FBAppCall handleOpenURL:url
|
||||
sourceApplication:sourceApplication];
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||
[FBAppEvents activateApp];
|
||||
[FBAppCall handleDidBecomeActive];
|
||||
}
|
||||
|
||||
// FBSample logic
|
||||
// It is important to close any FBSession object that is no longer useful
|
||||
- (void)applicationWillTerminate:(UIApplication *)application {
|
||||
[FBSession.activeSession close];
|
||||
}
|
||||
|
||||
#pragma mark end Template generated code
|
||||
|
||||
@end
|
||||
@@ -1,78 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon.png</string>
|
||||
<string>Icon@2x.png</string>
|
||||
<string>Icon-72.png</string>
|
||||
<string>Icon-72@2x.png</string>
|
||||
</array>
|
||||
<key>CFBundleIcons</key>
|
||||
<dict>
|
||||
<key>CFBundlePrimaryIcon</key>
|
||||
<dict>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon.png</string>
|
||||
<string>Icon@2x.png</string>
|
||||
<string>Icon-72.png</string>
|
||||
<string>Icon-72@2x.png</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.facebook.sdk.samples.graphapi</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>fb307234779396415</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>FacebookAppID</key>
|
||||
<string>307234779396415</string>
|
||||
<key>FacebookDisplayName</key>
|
||||
<string>GraphApiSample</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,16 +0,0 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'GraphApiSample' target in the 'GraphApiSample' project
|
||||
//
|
||||
|
||||
#import <Availability.h>
|
||||
|
||||
#ifndef __IPHONE_4_0
|
||||
#warning "This project uses features only available in iOS SDK 4.0 and later."
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
||||
#import <FacebookSDK/FacebookSDK.h>
|
||||
@@ -1,21 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
@interface GraphApiViewController : UIViewController
|
||||
|
||||
@end
|
||||
@@ -1,209 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <FacebookSDK/FacebookSDK.h>
|
||||
#import "GraphApiAppDelegate.h"
|
||||
#import "GraphApiViewController.h"
|
||||
|
||||
static NSString *loadingText = @"Loading...";
|
||||
|
||||
@interface GraphApiViewController ()
|
||||
|
||||
@property (strong, nonatomic) IBOutlet UIButton *buttonRequest;
|
||||
@property (strong, nonatomic) IBOutlet UITextField *textObjectID;
|
||||
@property (strong, nonatomic) IBOutlet UITextView *textOutput;
|
||||
@property (strong, nonatomic) FBRequestConnection *requestConnection;
|
||||
|
||||
- (IBAction)buttonRequestClickHandler:(id)sender;
|
||||
|
||||
- (void)sendRequests;
|
||||
|
||||
- (void)requestCompleted:(FBRequestConnection *)connection
|
||||
forFbID:(NSString *)fbID
|
||||
result:(id)result
|
||||
error:(NSError *)error;
|
||||
|
||||
@end
|
||||
|
||||
@implementation GraphApiViewController
|
||||
|
||||
@synthesize buttonRequest = _buttonRequest;
|
||||
@synthesize textObjectID = _textObjectID;
|
||||
@synthesize textOutput = _textOutput;
|
||||
@synthesize requestConnection = _requestConnection;
|
||||
|
||||
- (void)dealloc {
|
||||
[_requestConnection cancel];
|
||||
}
|
||||
|
||||
//
|
||||
// When the button is clicked, make sure we have a valid session and
|
||||
// call sendRequests.
|
||||
//
|
||||
- (void)buttonRequestClickHandler:(id)sender {
|
||||
// FBSample logic
|
||||
// Check to see whether we have already opened a session.
|
||||
if (FBSession.activeSession.isOpen) {
|
||||
// login is integrated with the send button -- so if open, we send
|
||||
[self sendRequests];
|
||||
} else {
|
||||
[FBSession openActiveSessionWithReadPermissions:nil
|
||||
allowLoginUI:YES
|
||||
completionHandler:^(FBSession *session,
|
||||
FBSessionState status,
|
||||
NSError *error) {
|
||||
// if login fails for any reason, we alert
|
||||
if (error) {
|
||||
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
|
||||
message:error.localizedDescription
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
// if otherwise we check to see if the session is open, an alternative to
|
||||
// to the FB_ISSESSIONOPENWITHSTATE helper-macro would be to check the isOpen
|
||||
// property of the session object; the macros are useful, however, for more
|
||||
// detailed state checking for FBSession objects
|
||||
} else if (FB_ISSESSIONOPENWITHSTATE(status)) {
|
||||
// send our requests if we successfully logged in
|
||||
[self sendRequests];
|
||||
}
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
// FBSample logic
|
||||
// Read the ids to request from textObjectID and generate a FBRequest
|
||||
// object for each one. Add these to the FBRequestConnection and
|
||||
// then connect to Facebook to get results. Store the FBRequestConnection
|
||||
// in case we need to cancel it before it returns.
|
||||
//
|
||||
// When a request returns results, call requestComplete:result:error.
|
||||
//
|
||||
- (void)sendRequests {
|
||||
// extract the id's for which we will request the profile
|
||||
NSArray *fbids = [self.textObjectID.text componentsSeparatedByString:@","];
|
||||
|
||||
if ([self.textObjectID.text length] == 0) {
|
||||
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error"
|
||||
message:@"Object ID is required"
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
otherButtonTitles:nil];
|
||||
[alert show];
|
||||
return;
|
||||
}
|
||||
|
||||
self.textOutput.text = loadingText;
|
||||
if ([self.textObjectID isFirstResponder]) {
|
||||
[self.textObjectID resignFirstResponder];
|
||||
}
|
||||
|
||||
// create the connection object
|
||||
FBRequestConnection *newConnection = [[FBRequestConnection alloc] init];
|
||||
|
||||
// for each fbid in the array, we create a request object to fetch
|
||||
// the profile, along with a handler to respond to the results of the request
|
||||
for (NSString *fbid in fbids) {
|
||||
|
||||
// create a handler block to handle the results of the request for fbid's profile
|
||||
FBRequestHandler handler =
|
||||
^(FBRequestConnection *connection, id result, NSError *error) {
|
||||
// output the results of the request
|
||||
[self requestCompleted:connection forFbID:fbid result:result error:error];
|
||||
};
|
||||
|
||||
// create the request object, using the fbid as the graph path
|
||||
// as an alternative the request* static methods of the FBRequest class could
|
||||
// be used to fetch common requests, such as /me and /me/friends
|
||||
FBRequest *request = [[FBRequest alloc] initWithSession:FBSession.activeSession
|
||||
graphPath:fbid];
|
||||
|
||||
// add the request to the connection object, if more than one request is added
|
||||
// the connection object will compose the requests as a batch request; whether or
|
||||
// not the request is a batch or a singleton, the handler behavior is the same,
|
||||
// allowing the application to be dynamic in regards to whether a single or multiple
|
||||
// requests are occuring
|
||||
[newConnection addRequest:request completionHandler:handler];
|
||||
}
|
||||
|
||||
// if there's an outstanding connection, just cancel
|
||||
[self.requestConnection cancel];
|
||||
|
||||
// keep track of our connection, and start it
|
||||
self.requestConnection = newConnection;
|
||||
[newConnection start];
|
||||
}
|
||||
|
||||
// FBSample logic
|
||||
// Report any results. Invoked once for each request we make.
|
||||
- (void)requestCompleted:(FBRequestConnection *)connection
|
||||
forFbID:fbID
|
||||
result:(id)result
|
||||
error:(NSError *)error {
|
||||
// not the completion we were looking for...
|
||||
if (self.requestConnection &&
|
||||
connection != self.requestConnection) {
|
||||
return;
|
||||
}
|
||||
|
||||
// clean this up, for posterity
|
||||
self.requestConnection = nil;
|
||||
|
||||
if ([self.textOutput.text isEqualToString:loadingText]) {
|
||||
self.textOutput.text = @"";
|
||||
}
|
||||
|
||||
NSString *text;
|
||||
if (error) {
|
||||
// error contains details about why the request failed
|
||||
text = error.localizedDescription;
|
||||
} else {
|
||||
// result is the json response from a successful request
|
||||
NSDictionary *dictionary = (NSDictionary *)result;
|
||||
// we pull the name property out, if there is one, and display it
|
||||
text = (NSString *)[dictionary objectForKey:@"name"];
|
||||
}
|
||||
|
||||
self.textOutput.text = [NSString stringWithFormat:@"%@%@: %@\r\n",
|
||||
self.textOutput.text,
|
||||
[fbID stringByTrimmingCharactersInSet:
|
||||
[NSCharacterSet whitespaceAndNewlineCharacterSet]],
|
||||
text];
|
||||
}
|
||||
|
||||
#pragma mark - View lifecycle
|
||||
|
||||
- (void)viewDidUnload {
|
||||
[super viewDidUnload];
|
||||
[self.requestConnection cancel];
|
||||
|
||||
self.buttonRequest = nil;
|
||||
self.textObjectID = nil;
|
||||
self.textOutput = nil;
|
||||
self.requestConnection = nil;
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// Return YES for supported orientations
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
|
||||
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
|
||||
} else {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
@end
|
||||
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 9.5 KiB |
|
Before Width: | Height: | Size: 22 KiB |
@@ -1,263 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1536</int>
|
||||
<string key="IBDocument.SystemVersion">12C2034</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2844</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.34</string>
|
||||
<string key="IBDocument.HIToolboxVersion">625.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">1930</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUIButton</string>
|
||||
<string>IBUITextField</string>
|
||||
<string>IBUITextView</string>
|
||||
<string>IBUIView</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</array>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<object class="IBProxyObject" id="841351856">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="606714003">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="766721923">
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="IBUITextField" id="1015700101">
|
||||
<reference key="NSNextResponder" ref="766721923"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{237, 23}, {294, 31}}</string>
|
||||
<reference key="NSSuperview" ref="766721923"/>
|
||||
<reference key="NSNextKeyView" ref="917985713"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:320</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<string key="IBUIText"/>
|
||||
<int key="IBUIBorderStyle">3</int>
|
||||
<string key="IBUIPlaceholder">Enter object ids (eg. 4,6)</string>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
<object class="NSColorSpace" key="NSCustomColorSpace" id="816482207">
|
||||
<int key="NSID">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
|
||||
<float key="IBUIMinimumFontSize">17</float>
|
||||
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription" id="150122454">
|
||||
<int key="type">1</int>
|
||||
<double key="pointSize">14</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont" id="1000055863">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">14</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUIButton" id="917985713">
|
||||
<reference key="NSNextResponder" ref="766721923"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{539, 20}, {105, 37}}</string>
|
||||
<reference key="NSSuperview" ref="766721923"/>
|
||||
<reference key="NSNextKeyView" ref="155633632"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:241</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<string key="IBUINormalTitle">Request</string>
|
||||
<object class="NSColor" key="IBUIHighlightedTitleColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleShadowColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription">
|
||||
<int key="type">2</int>
|
||||
<double key="pointSize">15</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica-Bold</string>
|
||||
<double key="NSSize">15</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUITextView" id="155633632">
|
||||
<reference key="NSNextResponder" ref="766721923"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 65}, {728, 919}}</string>
|
||||
<reference key="NSSuperview" ref="766721923"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:640</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MSAxIDEAA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<bool key="IBUIMultipleTouchEnabled">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<bool key="IBUIShowsHorizontalScrollIndicator">NO</bool>
|
||||
<string key="IBUIText"/>
|
||||
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
|
||||
<int key="IBUIAutocapitalizationType">2</int>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<reference key="IBUIFontDescription" ref="150122454"/>
|
||||
<reference key="IBUIFont" ref="1000055863"/>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{0, 20}, {768, 1004}}</string>
|
||||
<reference key="NSNextKeyView" ref="1015700101"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
<reference key="NSCustomColorSpace" ref="816482207"/>
|
||||
</object>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
|
||||
<int key="IBUIStatusBarStyle">2</int>
|
||||
</object>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<array class="NSMutableArray" key="connectionRecords">
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="766721923"/>
|
||||
</object>
|
||||
<int key="connectionID">3</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">buttonRequest</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="917985713"/>
|
||||
</object>
|
||||
<int key="connectionID">7</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">textObjectID</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="1015700101"/>
|
||||
</object>
|
||||
<int key="connectionID">8</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">textOutput</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="155633632"/>
|
||||
</object>
|
||||
<int key="connectionID">12</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">buttonRequestClickHandler:</string>
|
||||
<reference key="source" ref="917985713"/>
|
||||
<reference key="destination" ref="841351856"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<int key="connectionID">10</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<array key="object" id="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="841351856"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="606714003"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">2</int>
|
||||
<reference key="object" ref="766721923"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="917985713"/>
|
||||
<reference ref="1015700101"/>
|
||||
<reference ref="155633632"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">4</int>
|
||||
<reference key="object" ref="1015700101"/>
|
||||
<reference key="parent" ref="766721923"/>
|
||||
<string key="objectName">ObjectID</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">5</int>
|
||||
<reference key="object" ref="917985713"/>
|
||||
<reference key="parent" ref="766721923"/>
|
||||
<string key="objectName">Request</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">11</int>
|
||||
<reference key="object" ref="155633632"/>
|
||||
<reference key="parent" ref="766721923"/>
|
||||
<string key="objectName">Output</string>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
<string key="-1.CustomClassName">GraphApiViewController</string>
|
||||
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="-2.CustomClassName">UIResponder</string>
|
||||
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="11.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="4.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="5.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">12</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes"/>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">1930</string>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -1,263 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1536</int>
|
||||
<string key="IBDocument.SystemVersion">12C2034</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">2844</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.34</string>
|
||||
<string key="IBDocument.HIToolboxVersion">625.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">1930</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUIButton</string>
|
||||
<string>IBUITextField</string>
|
||||
<string>IBUITextView</string>
|
||||
<string>IBUIView</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</array>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="843779117">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="774585933">
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="IBUITextField" id="732549290">
|
||||
<reference key="NSNextResponder" ref="774585933"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 23}, {193, 31}}</string>
|
||||
<reference key="NSSuperview" ref="774585933"/>
|
||||
<reference key="NSNextKeyView" ref="862189586"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:304</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<string key="IBUIText"/>
|
||||
<int key="IBUIBorderStyle">3</int>
|
||||
<string key="IBUIPlaceholder">Enter object ids (eg. 4,6)</string>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MAA</bytes>
|
||||
<object class="NSColorSpace" key="NSCustomColorSpace" id="995191952">
|
||||
<int key="NSID">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<bool key="IBUIAdjustsFontSizeToFit">YES</bool>
|
||||
<float key="IBUIMinimumFontSize">17</float>
|
||||
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription" id="1056878096">
|
||||
<int key="type">1</int>
|
||||
<double key="pointSize">14</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont" id="1007493176">
|
||||
<string key="NSName">Helvetica</string>
|
||||
<double key="NSSize">14</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUIButton" id="862189586">
|
||||
<reference key="NSNextResponder" ref="774585933"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{219, 20}, {84, 37}}</string>
|
||||
<reference key="NSSuperview" ref="774585933"/>
|
||||
<reference key="NSNextKeyView" ref="1061159679"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:225</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<string key="IBUINormalTitle">Request</string>
|
||||
<object class="NSColor" key="IBUIHighlightedTitleColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MzQ2IDAuMzA5ODAzOTMyOSAwLjUyMTU2ODY1NgA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleShadowColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription">
|
||||
<int key="type">2</int>
|
||||
<double key="pointSize">15</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">Helvetica-Bold</string>
|
||||
<double key="NSSize">15</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUITextView" id="1061159679">
|
||||
<reference key="NSNextResponder" ref="774585933"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 65}, {280, 375}}</string>
|
||||
<reference key="NSSuperview" ref="774585933"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:639</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MSAxIDEAA</bytes>
|
||||
</object>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<bool key="IBUIMultipleTouchEnabled">YES</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBUIShowsHorizontalScrollIndicator">NO</bool>
|
||||
<bool key="IBUIEditable">NO</bool>
|
||||
<string key="IBUIText"/>
|
||||
<object class="IBUITextInputTraits" key="IBUITextInputTraits">
|
||||
<int key="IBUIAutocapitalizationType">2</int>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<reference key="IBUIFontDescription" ref="1056878096"/>
|
||||
<reference key="IBUIFont" ref="1007493176"/>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<reference key="NSNextKeyView" ref="732549290"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC43NQA</bytes>
|
||||
<reference key="NSCustomColorSpace" ref="995191952"/>
|
||||
</object>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<array class="NSMutableArray" key="connectionRecords">
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="774585933"/>
|
||||
</object>
|
||||
<int key="connectionID">7</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">buttonRequest</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="862189586"/>
|
||||
</object>
|
||||
<int key="connectionID">11</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">textObjectID</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="732549290"/>
|
||||
</object>
|
||||
<int key="connectionID">12</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">textOutput</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="1061159679"/>
|
||||
</object>
|
||||
<int key="connectionID">16</int>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">buttonRequestClickHandler:</string>
|
||||
<reference key="source" ref="862189586"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<int key="connectionID">14</int>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">0</int>
|
||||
<array key="object" id="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-1</int>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">-2</int>
|
||||
<reference key="object" ref="843779117"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">6</int>
|
||||
<reference key="object" ref="774585933"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="732549290"/>
|
||||
<reference ref="862189586"/>
|
||||
<reference ref="1061159679"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">8</int>
|
||||
<reference key="object" ref="732549290"/>
|
||||
<reference key="parent" ref="774585933"/>
|
||||
<string key="objectName">ObjectID</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">9</int>
|
||||
<reference key="object" ref="862189586"/>
|
||||
<reference key="parent" ref="774585933"/>
|
||||
<string key="objectName">Request</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<int key="objectID">15</int>
|
||||
<reference key="object" ref="1061159679"/>
|
||||
<reference key="parent" ref="774585933"/>
|
||||
<string key="objectName">Output</string>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
<string key="-1.CustomClassName">GraphApiViewController</string>
|
||||
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="-2.CustomClassName">UIResponder</string>
|
||||
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="15.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="8.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="9.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
<int key="maxID">16</int>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes"/>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">1930</string>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -1,2 +0,0 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "GraphApiAppDelegate.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([GraphApiAppDelegate class]));
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
Graph Api sample
|
||||
|
||||
Demonstrates the basics of how to make a singleton or batch request using the Facebook SDK for IOS.
|
||||
|
||||
Using the Sample
|
||||
Install the Facebook SDK for iOS.
|
||||
Launch the GraphApiSample project using Xcode from the <Facebook SDK>/samples/GraphApiSample directory.
|
||||
@@ -1,347 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
5F6AF18E1532A37B00DDBD75 /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F6AF18D1532A37B00DDBD75 /* UIKit.framework */; };
|
||||
5F6AF1901532A37B00DDBD75 /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F6AF18F1532A37B00DDBD75 /* Foundation.framework */; };
|
||||
5F6AF1921532A37B00DDBD75 /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5F6AF1911532A37B00DDBD75 /* CoreGraphics.framework */; };
|
||||
5F6AF1981532A37B00DDBD75 /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = 5F6AF1961532A37B00DDBD75 /* InfoPlist.strings */; };
|
||||
5F6AF19A1532A37B00DDBD75 /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F6AF1991532A37B00DDBD75 /* main.m */; };
|
||||
5F6AF19E1532A37B00DDBD75 /* HFAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F6AF19D1532A37B00DDBD75 /* HFAppDelegate.m */; };
|
||||
5F6AF1A11532A37B00DDBD75 /* HFViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = 5F6AF1A01532A37B00DDBD75 /* HFViewController.m */; };
|
||||
5F6AF1A41532A37B00DDBD75 /* HFViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5F6AF1A21532A37B00DDBD75 /* HFViewController_iPhone.xib */; };
|
||||
5F6AF1A71532A37B00DDBD75 /* HFViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = 5F6AF1A51532A37B00DDBD75 /* HFViewController_iPad.xib */; };
|
||||
5FC4959815C21151007EE54E /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = 5FC4959715C21151007EE54E /* CoreLocation.framework */; };
|
||||
85AFB50C158F9D78000AF7F5 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB508158F9D78000AF7F5 /* Icon-72.png */; };
|
||||
85AFB50D158F9D78000AF7F5 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB509158F9D78000AF7F5 /* Icon-72@2x.png */; };
|
||||
85AFB50E158F9D78000AF7F5 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB50A158F9D78000AF7F5 /* Icon.png */; };
|
||||
85AFB50F158F9D78000AF7F5 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB50B158F9D78000AF7F5 /* Icon@2x.png */; };
|
||||
85C69D8F1602B0D3008AD9A0 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69D8C1602B0D3008AD9A0 /* Default-568h@2x.png */; };
|
||||
85C69D901602B0D3008AD9A0 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69D8D1602B0D3008AD9A0 /* Default.png */; };
|
||||
85C69D911602B0D3008AD9A0 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69D8E1602B0D3008AD9A0 /* Default@2x.png */; };
|
||||
DD37EAC015ABA8FA0015966B /* FacebookSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD37EABF15ABA8FA0015966B /* FacebookSDK.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
5F6AF1891532A37B00DDBD75 /* HelloFacebookSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = HelloFacebookSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
5F6AF18D1532A37B00DDBD75 /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
5F6AF18F1532A37B00DDBD75 /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
5F6AF1911532A37B00DDBD75 /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
5F6AF1951532A37B00DDBD75 /* HelloFacebookSample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "HelloFacebookSample-Info.plist"; sourceTree = "<group>"; };
|
||||
5F6AF1971532A37B00DDBD75 /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
5F6AF1991532A37B00DDBD75 /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
5F6AF19B1532A37B00DDBD75 /* HelloFacebookSample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "HelloFacebookSample-Prefix.pch"; sourceTree = "<group>"; };
|
||||
5F6AF19C1532A37B00DDBD75 /* HFAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HFAppDelegate.h; sourceTree = "<group>"; };
|
||||
5F6AF19D1532A37B00DDBD75 /* HFAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HFAppDelegate.m; sourceTree = "<group>"; };
|
||||
5F6AF19F1532A37B00DDBD75 /* HFViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = HFViewController.h; sourceTree = "<group>"; };
|
||||
5F6AF1A01532A37B00DDBD75 /* HFViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = HFViewController.m; sourceTree = "<group>"; };
|
||||
5F6AF1A31532A37B00DDBD75 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/HFViewController_iPhone.xib; sourceTree = "<group>"; };
|
||||
5F6AF1A61532A37B00DDBD75 /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/HFViewController_iPad.xib; sourceTree = "<group>"; };
|
||||
5FC4959715C21151007EE54E /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
|
||||
85AFB508158F9D78000AF7F5 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
|
||||
85AFB509158F9D78000AF7F5 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72@2x.png"; sourceTree = "<group>"; };
|
||||
85AFB50A158F9D78000AF7F5 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
|
||||
85AFB50B158F9D78000AF7F5 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = "<group>"; };
|
||||
85C69D8C1602B0D3008AD9A0 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
|
||||
85C69D8D1602B0D3008AD9A0 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
|
||||
85C69D8E1602B0D3008AD9A0 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
|
||||
DD37EABF15ABA8FA0015966B /* FacebookSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FacebookSDK.framework; path = ../../build/FacebookSDK.framework; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
5F6AF1861532A37B00DDBD75 /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5F6AF18E1532A37B00DDBD75 /* UIKit.framework in Frameworks */,
|
||||
5F6AF1901532A37B00DDBD75 /* Foundation.framework in Frameworks */,
|
||||
5F6AF1921532A37B00DDBD75 /* CoreGraphics.framework in Frameworks */,
|
||||
DD37EAC015ABA8FA0015966B /* FacebookSDK.framework in Frameworks */,
|
||||
5FC4959815C21151007EE54E /* CoreLocation.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
5F6AF17E1532A37B00DDBD75 = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5F6AF1931532A37B00DDBD75 /* HelloFacebookSample */,
|
||||
5F6AF18C1532A37B00DDBD75 /* Frameworks */,
|
||||
5F6AF18A1532A37B00DDBD75 /* Products */,
|
||||
);
|
||||
indentWidth = 4;
|
||||
sourceTree = "<group>";
|
||||
tabWidth = 4;
|
||||
};
|
||||
5F6AF18A1532A37B00DDBD75 /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5F6AF1891532A37B00DDBD75 /* HelloFacebookSample.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5F6AF18C1532A37B00DDBD75 /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5FC4959715C21151007EE54E /* CoreLocation.framework */,
|
||||
DD37EABF15ABA8FA0015966B /* FacebookSDK.framework */,
|
||||
5F6AF18D1532A37B00DDBD75 /* UIKit.framework */,
|
||||
5F6AF18F1532A37B00DDBD75 /* Foundation.framework */,
|
||||
5F6AF1911532A37B00DDBD75 /* CoreGraphics.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5F6AF1931532A37B00DDBD75 /* HelloFacebookSample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
5F6AF19C1532A37B00DDBD75 /* HFAppDelegate.h */,
|
||||
5F6AF19D1532A37B00DDBD75 /* HFAppDelegate.m */,
|
||||
5F6AF19F1532A37B00DDBD75 /* HFViewController.h */,
|
||||
5F6AF1A01532A37B00DDBD75 /* HFViewController.m */,
|
||||
5F6AF1A21532A37B00DDBD75 /* HFViewController_iPhone.xib */,
|
||||
5F6AF1A51532A37B00DDBD75 /* HFViewController_iPad.xib */,
|
||||
5F6AF1941532A37B00DDBD75 /* Supporting Files */,
|
||||
);
|
||||
path = HelloFacebookSample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5F6AF1941532A37B00DDBD75 /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
85C69D8C1602B0D3008AD9A0 /* Default-568h@2x.png */,
|
||||
85C69D8D1602B0D3008AD9A0 /* Default.png */,
|
||||
85C69D8E1602B0D3008AD9A0 /* Default@2x.png */,
|
||||
85AFB508158F9D78000AF7F5 /* Icon-72.png */,
|
||||
85AFB509158F9D78000AF7F5 /* Icon-72@2x.png */,
|
||||
85AFB50A158F9D78000AF7F5 /* Icon.png */,
|
||||
85AFB50B158F9D78000AF7F5 /* Icon@2x.png */,
|
||||
5F6AF1951532A37B00DDBD75 /* HelloFacebookSample-Info.plist */,
|
||||
5F6AF1961532A37B00DDBD75 /* InfoPlist.strings */,
|
||||
5F6AF1991532A37B00DDBD75 /* main.m */,
|
||||
5F6AF19B1532A37B00DDBD75 /* HelloFacebookSample-Prefix.pch */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
5F6AF1881532A37B00DDBD75 /* HelloFacebookSample */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = 5F6AF1AA1532A37B00DDBD75 /* Build configuration list for PBXNativeTarget "HelloFacebookSample" */;
|
||||
buildPhases = (
|
||||
5F6AF1851532A37B00DDBD75 /* Sources */,
|
||||
5F6AF1861532A37B00DDBD75 /* Frameworks */,
|
||||
5F6AF1871532A37B00DDBD75 /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = HelloFacebookSample;
|
||||
productName = HelloFacebookSample;
|
||||
productReference = 5F6AF1891532A37B00DDBD75 /* HelloFacebookSample.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
5F6AF1801532A37B00DDBD75 /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0420;
|
||||
};
|
||||
buildConfigurationList = 5F6AF1831532A37B00DDBD75 /* Build configuration list for PBXProject "HelloFacebookSample" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
he,
|
||||
);
|
||||
mainGroup = 5F6AF17E1532A37B00DDBD75;
|
||||
productRefGroup = 5F6AF18A1532A37B00DDBD75 /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
5F6AF1881532A37B00DDBD75 /* HelloFacebookSample */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
5F6AF1871532A37B00DDBD75 /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5F6AF1981532A37B00DDBD75 /* InfoPlist.strings in Resources */,
|
||||
5F6AF1A41532A37B00DDBD75 /* HFViewController_iPhone.xib in Resources */,
|
||||
5F6AF1A71532A37B00DDBD75 /* HFViewController_iPad.xib in Resources */,
|
||||
85AFB50C158F9D78000AF7F5 /* Icon-72.png in Resources */,
|
||||
85AFB50D158F9D78000AF7F5 /* Icon-72@2x.png in Resources */,
|
||||
85AFB50E158F9D78000AF7F5 /* Icon.png in Resources */,
|
||||
85AFB50F158F9D78000AF7F5 /* Icon@2x.png in Resources */,
|
||||
85C69D8F1602B0D3008AD9A0 /* Default-568h@2x.png in Resources */,
|
||||
85C69D901602B0D3008AD9A0 /* Default.png in Resources */,
|
||||
85C69D911602B0D3008AD9A0 /* Default@2x.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
5F6AF1851532A37B00DDBD75 /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
5F6AF19A1532A37B00DDBD75 /* main.m in Sources */,
|
||||
5F6AF19E1532A37B00DDBD75 /* HFAppDelegate.m in Sources */,
|
||||
5F6AF1A11532A37B00DDBD75 /* HFViewController.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
5F6AF1961532A37B00DDBD75 /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
5F6AF1971532A37B00DDBD75 /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5F6AF1A21532A37B00DDBD75 /* HFViewController_iPhone.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
5F6AF1A31532A37B00DDBD75 /* en */,
|
||||
);
|
||||
name = HFViewController_iPhone.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
5F6AF1A51532A37B00DDBD75 /* HFViewController_iPad.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
5F6AF1A61532A37B00DDBD75 /* en */,
|
||||
);
|
||||
name = HFViewController_iPad.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
5F6AF1A81532A37B00DDBD75 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
5F6AF1A91532A37B00DDBD75 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_ABOUT_MISSING_PROTOTYPES = YES;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
5F6AF1AB1532A37B00DDBD75 /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/../../build\"",
|
||||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "HelloFacebookSample/HelloFacebookSample-Prefix.pch";
|
||||
INFOPLIST_FILE = "HelloFacebookSample/HelloFacebookSample-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = HelloFacebookSample;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
5F6AF1AC1532A37B00DDBD75 /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/../../build\"",
|
||||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "HelloFacebookSample/HelloFacebookSample-Prefix.pch";
|
||||
INFOPLIST_FILE = "HelloFacebookSample/HelloFacebookSample-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = HelloFacebookSample;
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
5F6AF1831532A37B00DDBD75 /* Build configuration list for PBXProject "HelloFacebookSample" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
5F6AF1A81532A37B00DDBD75 /* Debug */,
|
||||
5F6AF1A91532A37B00DDBD75 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
5F6AF1AA1532A37B00DDBD75 /* Build configuration list for PBXNativeTarget "HelloFacebookSample" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
5F6AF1AB1532A37B00DDBD75 /* Debug */,
|
||||
5F6AF1AC1532A37B00DDBD75 /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = 5F6AF1801532A37B00DDBD75 /* Project object */;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 16 KiB |
@@ -1,39 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <FacebookSDK/FacebookSDK.h>
|
||||
|
||||
// Hello Facebook sample application
|
||||
//
|
||||
// The purpose of this sample application is show how to use Facebook to
|
||||
// personalize an application experience and perform a set of typical actions.
|
||||
// These include:
|
||||
// - managing login and logout using FBSession
|
||||
// - how to request and display additional user data using FBRequest
|
||||
// - use of FBProfilePictureView to display a profile picture
|
||||
// - how to post a Facebook status update
|
||||
// - how to upload a photo to Facebook
|
||||
// - how to invoke the FBFriendPickerViewController to select a set of friends.
|
||||
|
||||
@class HFViewController;
|
||||
|
||||
@interface HFAppDelegate : UIResponder<UIApplicationDelegate>
|
||||
|
||||
@property (strong, nonatomic) UIWindow *window;
|
||||
@property (strong, nonatomic) HFViewController *rootViewController;
|
||||
|
||||
@end
|
||||
@@ -1,79 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "HFAppDelegate.h"
|
||||
|
||||
#import "HFViewController.h"
|
||||
#import <FacebookSDK/FacebookSDK.h>
|
||||
|
||||
@implementation HFAppDelegate
|
||||
|
||||
@synthesize window = _window;
|
||||
@synthesize rootViewController = _rootViewController;
|
||||
|
||||
// FBSample logic
|
||||
// If we have a valid session at the time of openURL call, we handle Facebook transitions
|
||||
// by passing the url argument to handleOpenURL; see the "Just Login" sample application for
|
||||
// a more detailed discussion of handleOpenURL
|
||||
- (BOOL)application:(UIApplication *)application
|
||||
openURL:(NSURL *)url
|
||||
sourceApplication:(NSString *)sourceApplication
|
||||
annotation:(id)annotation {
|
||||
// attempt to extract a token from the url
|
||||
return [FBAppCall handleOpenURL:url
|
||||
sourceApplication:sourceApplication
|
||||
fallbackHandler:^(FBAppCall *call) {
|
||||
NSLog(@"In fallback handler");
|
||||
}];
|
||||
}
|
||||
|
||||
- (void)applicationWillTerminate:(UIApplication *)application {
|
||||
// FBSample logic
|
||||
// if the app is going away, we close the session object
|
||||
[FBSession.activeSession close];
|
||||
}
|
||||
|
||||
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
|
||||
// If you have not added the -ObjC linker flag, you may need to uncomment the following line because
|
||||
// Nib files require the type to have been loaded before they can do the wireup successfully.
|
||||
// http://stackoverflow.com/questions/1725881/unknown-class-myclass-in-interface-builder-file-error-at-runtime
|
||||
// [FBProfilePictureView class];
|
||||
|
||||
self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
|
||||
// Override point for customization after application launch.
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
|
||||
self.window.rootViewController = [[HFViewController alloc] initWithNibName:@"HFViewController_iPhone" bundle:nil];
|
||||
} else {
|
||||
self.window.rootViewController = [[HFViewController alloc] initWithNibName:@"HFViewController_iPad" bundle:nil];
|
||||
}
|
||||
|
||||
[self.window makeKeyAndVisible];
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
- (void)applicationDidBecomeActive:(UIApplication *)application {
|
||||
// FBSample logic
|
||||
// Call the 'activateApp' method to log an app event for use in analytics and advertising reporting.
|
||||
[FBAppEvents activateApp];
|
||||
|
||||
// FBSample logic
|
||||
// We need to properly handle activation of the application with regards to SSO
|
||||
// (e.g., returning from iOS 6.0 authorization dialog or from fast app switching).
|
||||
[FBAppCall handleDidBecomeActive];
|
||||
}
|
||||
|
||||
@end
|
||||
@@ -1,22 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <FacebookSDK/FacebookSDK.h>
|
||||
|
||||
@interface HFViewController : UIViewController
|
||||
|
||||
@end
|
||||
@@ -1,390 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import "HFViewController.h"
|
||||
|
||||
#import "HFAppDelegate.h"
|
||||
#import <CoreLocation/CoreLocation.h>
|
||||
|
||||
|
||||
@interface HFViewController () <FBLoginViewDelegate>
|
||||
|
||||
@property (strong, nonatomic) IBOutlet FBProfilePictureView *profilePic;
|
||||
@property (strong, nonatomic) IBOutlet UIButton *buttonPostStatus;
|
||||
@property (strong, nonatomic) IBOutlet UIButton *buttonPostPhoto;
|
||||
@property (strong, nonatomic) IBOutlet UIButton *buttonPickFriends;
|
||||
@property (strong, nonatomic) IBOutlet UIButton *buttonPickPlace;
|
||||
@property (strong, nonatomic) IBOutlet UILabel *labelFirstName;
|
||||
@property (strong, nonatomic) id<FBGraphUser> loggedInUser;
|
||||
|
||||
- (IBAction)postStatusUpdateClick:(UIButton *)sender;
|
||||
- (IBAction)postPhotoClick:(UIButton *)sender;
|
||||
- (IBAction)pickFriendsClick:(UIButton *)sender;
|
||||
- (IBAction)pickPlaceClick:(UIButton *)sender;
|
||||
|
||||
- (void)showAlert:(NSString *)message
|
||||
result:(id)result
|
||||
error:(NSError *)error;
|
||||
|
||||
|
||||
@end
|
||||
|
||||
@implementation HFViewController
|
||||
|
||||
@synthesize buttonPostStatus = _buttonPostStatus;
|
||||
@synthesize buttonPostPhoto = _buttonPostPhoto;
|
||||
@synthesize buttonPickFriends = _buttonPickFriends;
|
||||
@synthesize buttonPickPlace = _buttonPickPlace;
|
||||
@synthesize labelFirstName = _labelFirstName;
|
||||
@synthesize loggedInUser = _loggedInUser;
|
||||
@synthesize profilePic = _profilePic;
|
||||
|
||||
#pragma mark - UIViewController
|
||||
|
||||
- (void)viewDidLoad {
|
||||
[super viewDidLoad];
|
||||
|
||||
// Create Login View so that the app will be granted "status_update" permission.
|
||||
FBLoginView *loginview = [[FBLoginView alloc] init];
|
||||
|
||||
loginview.frame = CGRectOffset(loginview.frame, 5, 5);
|
||||
#ifdef __IPHONE_7_0
|
||||
#ifdef __IPHONE_OS_VERSION_MAX_ALLOWED
|
||||
#if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_7_0
|
||||
if ([self respondsToSelector:@selector(setEdgesForExtendedLayout:)]) {
|
||||
loginview.frame = CGRectOffset(loginview.frame, 5, 25);
|
||||
}
|
||||
#endif
|
||||
#endif
|
||||
#endif
|
||||
loginview.delegate = self;
|
||||
|
||||
[self.view addSubview:loginview];
|
||||
|
||||
[loginview sizeToFit];
|
||||
}
|
||||
|
||||
- (void)viewDidUnload {
|
||||
self.buttonPickFriends = nil;
|
||||
self.buttonPickPlace = nil;
|
||||
self.buttonPostPhoto = nil;
|
||||
self.buttonPostStatus = nil;
|
||||
self.labelFirstName = nil;
|
||||
self.loggedInUser = nil;
|
||||
self.profilePic = nil;
|
||||
[super viewDidUnload];
|
||||
}
|
||||
|
||||
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
|
||||
// Return YES for supported orientations
|
||||
if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) {
|
||||
return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
|
||||
} else {
|
||||
return YES;
|
||||
}
|
||||
}
|
||||
|
||||
#pragma mark - FBLoginViewDelegate
|
||||
|
||||
- (void)loginViewShowingLoggedInUser:(FBLoginView *)loginView {
|
||||
// first get the buttons set for login mode
|
||||
self.buttonPostPhoto.enabled = YES;
|
||||
self.buttonPostStatus.enabled = YES;
|
||||
self.buttonPickFriends.enabled = YES;
|
||||
self.buttonPickPlace.enabled = YES;
|
||||
|
||||
// "Post Status" available when logged on and potentially when logged off. Differentiate in the label.
|
||||
[self.buttonPostStatus setTitle:@"Post Status Update (Logged On)" forState:self.buttonPostStatus.state];
|
||||
}
|
||||
|
||||
- (void)loginViewFetchedUserInfo:(FBLoginView *)loginView
|
||||
user:(id<FBGraphUser>)user {
|
||||
// here we use helper properties of FBGraphUser to dot-through to first_name and
|
||||
// id properties of the json response from the server; alternatively we could use
|
||||
// NSDictionary methods such as objectForKey to get values from the my json object
|
||||
self.labelFirstName.text = [NSString stringWithFormat:@"Hello %@!", user.first_name];
|
||||
// setting the profileID property of the FBProfilePictureView instance
|
||||
// causes the control to fetch and display the profile picture for the user
|
||||
self.profilePic.profileID = user.id;
|
||||
self.loggedInUser = user;
|
||||
}
|
||||
|
||||
- (void)loginViewShowingLoggedOutUser:(FBLoginView *)loginView {
|
||||
// test to see if we can use the share dialog built into the Facebook application
|
||||
FBShareDialogParams *p = [[FBShareDialogParams alloc] init];
|
||||
p.link = [NSURL URLWithString:@"http://developers.facebook.com/ios"];
|
||||
#ifdef DEBUG
|
||||
[FBSettings enableBetaFeatures:FBBetaFeaturesShareDialog];
|
||||
#endif
|
||||
BOOL canShareFB = [FBDialogs canPresentShareDialogWithParams:p];
|
||||
BOOL canShareiOS6 = [FBDialogs canPresentOSIntegratedShareDialogWithSession:nil];
|
||||
|
||||
self.buttonPostStatus.enabled = canShareFB || canShareiOS6;
|
||||
self.buttonPostPhoto.enabled = NO;
|
||||
self.buttonPickFriends.enabled = NO;
|
||||
self.buttonPickPlace.enabled = NO;
|
||||
|
||||
// "Post Status" available when logged on and potentially when logged off. Differentiate in the label.
|
||||
[self.buttonPostStatus setTitle:@"Post Status Update (Logged Off)" forState:self.buttonPostStatus.state];
|
||||
|
||||
self.profilePic.profileID = nil;
|
||||
self.labelFirstName.text = nil;
|
||||
self.loggedInUser = nil;
|
||||
}
|
||||
|
||||
- (void)loginView:(FBLoginView *)loginView handleError:(NSError *)error {
|
||||
// see https://developers.facebook.com/docs/reference/api/errors/ for general guidance on error handling for Facebook API
|
||||
// our policy here is to let the login view handle errors, but to log the results
|
||||
NSLog(@"FBLoginView encountered an error=%@", error);
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
// Convenience method to perform some action that requires the "publish_actions" permissions.
|
||||
- (void) performPublishAction:(void (^)(void)) action {
|
||||
// we defer request for permission to post to the moment of post, then we check for the permission
|
||||
if ([FBSession.activeSession.permissions indexOfObject:@"publish_actions"] == NSNotFound) {
|
||||
// if we don't already have the permission, then we request it now
|
||||
[FBSession.activeSession requestNewPublishPermissions:@[@"publish_actions"]
|
||||
defaultAudience:FBSessionDefaultAudienceFriends
|
||||
completionHandler:^(FBSession *session, NSError *error) {
|
||||
if (!error) {
|
||||
action();
|
||||
} else if (error.fberrorCategory != FBErrorCategoryUserCancelled){
|
||||
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:@"Permission denied"
|
||||
message:@"Unable to get permission to post"
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
otherButtonTitles:nil];
|
||||
[alertView show];
|
||||
}
|
||||
}];
|
||||
} else {
|
||||
action();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// Post Status Update button handler; will attempt different approaches depending upon configuration.
|
||||
- (IBAction)postStatusUpdateClick:(UIButton *)sender {
|
||||
// Post a status update to the user's feed via the Graph API, and display an alert view
|
||||
// with the results or an error.
|
||||
|
||||
NSURL *urlToShare = [NSURL URLWithString:@"http://developers.facebook.com/ios"];
|
||||
|
||||
// This code demonstrates 3 different ways of sharing using the Facebook SDK.
|
||||
// The first method tries to share via the Facebook app. This allows sharing without
|
||||
// the user having to authorize your app, and is available as long as the user has the
|
||||
// correct Facebook app installed. This publish will result in a fast-app-switch to the
|
||||
// Facebook app.
|
||||
// The second method tries to share via Facebook's iOS6 integration, which also
|
||||
// allows sharing without the user having to authorize your app, and is available as
|
||||
// long as the user has linked their Facebook account with iOS6. This publish will
|
||||
// result in a popup iOS6 dialog.
|
||||
// The third method tries to share via a Graph API request. This does require the user
|
||||
// to authorize your app. They must also grant your app publish permissions. This
|
||||
// allows the app to publish without any user interaction.
|
||||
|
||||
// If it is available, we will first try to post using the share dialog in the Facebook app
|
||||
FBAppCall *appCall = [FBDialogs presentShareDialogWithLink:urlToShare
|
||||
name:@"Hello Facebook"
|
||||
caption:nil
|
||||
description:@"The 'Hello Facebook' sample application showcases simple Facebook integration."
|
||||
picture:nil
|
||||
clientState:nil
|
||||
handler:^(FBAppCall *call, NSDictionary *results, NSError *error) {
|
||||
if (error) {
|
||||
NSLog(@"Error: %@", error.description);
|
||||
} else {
|
||||
NSLog(@"Success!");
|
||||
}
|
||||
}];
|
||||
|
||||
if (!appCall) {
|
||||
// Next try to post using Facebook's iOS6 integration
|
||||
BOOL displayedNativeDialog = [FBDialogs presentOSIntegratedShareDialogModallyFrom:self
|
||||
initialText:nil
|
||||
image:nil
|
||||
url:urlToShare
|
||||
handler:nil];
|
||||
|
||||
if (!displayedNativeDialog) {
|
||||
// Lastly, fall back on a request for permissions and a direct post using the Graph API
|
||||
[self performPublishAction:^{
|
||||
NSString *message = [NSString stringWithFormat:@"Updating status for %@ at %@", self.loggedInUser.first_name, [NSDate date]];
|
||||
|
||||
FBRequestConnection *connection = [[FBRequestConnection alloc] init];
|
||||
|
||||
connection.errorBehavior = FBRequestConnectionErrorBehaviorReconnectSession
|
||||
| FBRequestConnectionErrorBehaviorAlertUser
|
||||
| FBRequestConnectionErrorBehaviorRetry;
|
||||
|
||||
[connection addRequest:[FBRequest requestForPostStatusUpdate:message]
|
||||
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
|
||||
|
||||
[self showAlert:message result:result error:error];
|
||||
self.buttonPostStatus.enabled = YES;
|
||||
}];
|
||||
[connection start];
|
||||
|
||||
self.buttonPostStatus.enabled = NO;
|
||||
}];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Post Photo button handler
|
||||
- (IBAction)postPhotoClick:(UIButton *)sender {
|
||||
// Just use the icon image from the application itself. A real app would have a more
|
||||
// useful way to get an image.
|
||||
UIImage *img = [UIImage imageNamed:@"Icon-72@2x.png"];
|
||||
|
||||
[self performPublishAction:^{
|
||||
FBRequestConnection *connection = [[FBRequestConnection alloc] init];
|
||||
connection.errorBehavior = FBRequestConnectionErrorBehaviorReconnectSession
|
||||
| FBRequestConnectionErrorBehaviorAlertUser
|
||||
| FBRequestConnectionErrorBehaviorRetry;
|
||||
|
||||
[connection addRequest:[FBRequest requestForUploadPhoto:img]
|
||||
completionHandler:^(FBRequestConnection *connection, id result, NSError *error) {
|
||||
|
||||
[self showAlert:@"Photo Post" result:result error:error];
|
||||
if (FBSession.activeSession.isOpen) {
|
||||
self.buttonPostPhoto.enabled = YES;
|
||||
}
|
||||
}];
|
||||
[connection start];
|
||||
|
||||
self.buttonPostPhoto.enabled = NO;
|
||||
}];
|
||||
}
|
||||
|
||||
// Pick Friends button handler
|
||||
- (IBAction)pickFriendsClick:(UIButton *)sender {
|
||||
FBFriendPickerViewController *friendPickerController = [[FBFriendPickerViewController alloc] init];
|
||||
friendPickerController.title = @"Pick Friends";
|
||||
[friendPickerController loadData];
|
||||
|
||||
// Use the modal wrapper method to display the picker.
|
||||
[friendPickerController presentModallyFromViewController:self animated:YES handler:
|
||||
^(FBViewController *sender, BOOL donePressed) {
|
||||
|
||||
if (!donePressed) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *message;
|
||||
|
||||
if (friendPickerController.selection.count == 0) {
|
||||
message = @"<No Friends Selected>";
|
||||
} else {
|
||||
|
||||
NSMutableString *text = [[NSMutableString alloc] init];
|
||||
|
||||
// we pick up the users from the selection, and create a string that we use to update the text view
|
||||
// at the bottom of the display; note that self.selection is a property inherited from our base class
|
||||
for (id<FBGraphUser> user in friendPickerController.selection) {
|
||||
if ([text length]) {
|
||||
[text appendString:@", "];
|
||||
}
|
||||
[text appendString:user.name];
|
||||
}
|
||||
message = text;
|
||||
}
|
||||
|
||||
[[[UIAlertView alloc] initWithTitle:@"You Picked:"
|
||||
message:message
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
otherButtonTitles:nil]
|
||||
show];
|
||||
}];
|
||||
}
|
||||
|
||||
// Pick Place button handler
|
||||
- (IBAction)pickPlaceClick:(UIButton *)sender {
|
||||
FBPlacePickerViewController *placePickerController = [[FBPlacePickerViewController alloc] init];
|
||||
placePickerController.title = @"Pick a Seattle Place";
|
||||
placePickerController.locationCoordinate = CLLocationCoordinate2DMake(47.6097, -122.3331);
|
||||
[placePickerController loadData];
|
||||
|
||||
// Use the modal wrapper method to display the picker.
|
||||
[placePickerController presentModallyFromViewController:self animated:YES handler:
|
||||
^(FBViewController *sender, BOOL donePressed) {
|
||||
|
||||
if (!donePressed) {
|
||||
return;
|
||||
}
|
||||
|
||||
NSString *placeName = placePickerController.selection.name;
|
||||
if (!placeName) {
|
||||
placeName = @"<No Place Selected>";
|
||||
}
|
||||
|
||||
[[[UIAlertView alloc] initWithTitle:@"You Picked:"
|
||||
message:placeName
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
otherButtonTitles:nil]
|
||||
show];
|
||||
}];
|
||||
}
|
||||
|
||||
// UIAlertView helper for post buttons
|
||||
- (void)showAlert:(NSString *)message
|
||||
result:(id)result
|
||||
error:(NSError *)error {
|
||||
|
||||
NSString *alertMsg;
|
||||
NSString *alertTitle;
|
||||
if (error) {
|
||||
alertTitle = @"Error";
|
||||
// Since we use FBRequestConnectionErrorBehaviorAlertUser,
|
||||
// we do not need to surface our own alert view if there is an
|
||||
// an fberrorUserMessage unless the session is closed.
|
||||
if (error.fberrorUserMessage && FBSession.activeSession.isOpen) {
|
||||
alertTitle = nil;
|
||||
|
||||
} else {
|
||||
// Otherwise, use a general "connection problem" message.
|
||||
alertMsg = @"Operation failed due to a connection problem, retry later.";
|
||||
}
|
||||
} else {
|
||||
NSDictionary *resultDict = (NSDictionary *)result;
|
||||
alertMsg = [NSString stringWithFormat:@"Successfully posted '%@'.", message];
|
||||
NSString *postId = [resultDict valueForKey:@"id"];
|
||||
if (!postId) {
|
||||
postId = [resultDict valueForKey:@"postId"];
|
||||
}
|
||||
if (postId) {
|
||||
alertMsg = [NSString stringWithFormat:@"%@\nPost ID: %@", alertMsg, postId];
|
||||
}
|
||||
alertTitle = @"Success";
|
||||
}
|
||||
|
||||
if (alertTitle) {
|
||||
UIAlertView *alertView = [[UIAlertView alloc] initWithTitle:alertTitle
|
||||
message:alertMsg
|
||||
delegate:nil
|
||||
cancelButtonTitle:@"OK"
|
||||
otherButtonTitles:nil];
|
||||
[alertView show];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
@end
|
||||
@@ -1,78 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
|
||||
<plist version="1.0">
|
||||
<dict>
|
||||
<key>CFBundleDevelopmentRegion</key>
|
||||
<string>en</string>
|
||||
<key>CFBundleDisplayName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundleExecutable</key>
|
||||
<string>${EXECUTABLE_NAME}</string>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon.png</string>
|
||||
<string>Icon@2x.png</string>
|
||||
<string>Icon-72.png</string>
|
||||
<string>Icon-72@2x.png</string>
|
||||
</array>
|
||||
<key>CFBundleIcons</key>
|
||||
<dict>
|
||||
<key>CFBundlePrimaryIcon</key>
|
||||
<dict>
|
||||
<key>CFBundleIconFiles</key>
|
||||
<array>
|
||||
<string>Icon.png</string>
|
||||
<string>Icon@2x.png</string>
|
||||
<string>Icon-72.png</string>
|
||||
<string>Icon-72@2x.png</string>
|
||||
</array>
|
||||
</dict>
|
||||
</dict>
|
||||
<key>CFBundleIdentifier</key>
|
||||
<string>com.facebook.sdk.samples.hellofacebook</string>
|
||||
<key>CFBundleInfoDictionaryVersion</key>
|
||||
<string>6.0</string>
|
||||
<key>CFBundleName</key>
|
||||
<string>${PRODUCT_NAME}</string>
|
||||
<key>CFBundlePackageType</key>
|
||||
<string>APPL</string>
|
||||
<key>CFBundleShortVersionString</key>
|
||||
<string>1.0</string>
|
||||
<key>CFBundleSignature</key>
|
||||
<string>????</string>
|
||||
<key>CFBundleURLTypes</key>
|
||||
<array>
|
||||
<dict>
|
||||
<key>CFBundleURLSchemes</key>
|
||||
<array>
|
||||
<string>fb355198514515820</string>
|
||||
</array>
|
||||
</dict>
|
||||
</array>
|
||||
<key>CFBundleVersion</key>
|
||||
<string>1.0</string>
|
||||
<key>FacebookAppID</key>
|
||||
<string>355198514515820</string>
|
||||
<key>FacebookDisplayName</key>
|
||||
<string>HelloFBSample</string>
|
||||
<key>LSRequiresIPhoneOS</key>
|
||||
<true/>
|
||||
<key>UIRequiredDeviceCapabilities</key>
|
||||
<array>
|
||||
<string>armv7</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
<key>UISupportedInterfaceOrientations~ipad</key>
|
||||
<array>
|
||||
<string>UIInterfaceOrientationPortrait</string>
|
||||
<string>UIInterfaceOrientationPortraitUpsideDown</string>
|
||||
<string>UIInterfaceOrientationLandscapeLeft</string>
|
||||
<string>UIInterfaceOrientationLandscapeRight</string>
|
||||
</array>
|
||||
</dict>
|
||||
</plist>
|
||||
@@ -1,14 +0,0 @@
|
||||
//
|
||||
// Prefix header for all source files of the 'HelloFacebookSample' target in the 'HelloFacebookSample' project
|
||||
//
|
||||
|
||||
#import <Availability.h>
|
||||
|
||||
#ifndef __IPHONE_4_0
|
||||
#warning "This project uses features only available in iOS SDK 4.0 and later."
|
||||
#endif
|
||||
|
||||
#ifdef __OBJC__
|
||||
#import <UIKit/UIKit.h>
|
||||
#import <Foundation/Foundation.h>
|
||||
#endif
|
||||
|
Before Width: | Height: | Size: 11 KiB |
|
Before Width: | Height: | Size: 24 KiB |
|
Before Width: | Height: | Size: 9.6 KiB |
|
Before Width: | Height: | Size: 20 KiB |
@@ -1,483 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.iPad.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1280</int>
|
||||
<string key="IBDocument.SystemVersion">12E55</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">4504</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.39</string>
|
||||
<string key="IBDocument.HIToolboxVersion">626.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">3734.1</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUIButton</string>
|
||||
<string>IBUILabel</string>
|
||||
<string>IBUIView</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</array>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<object class="IBProxyObject" id="841351856">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="606714003">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="766721923">
|
||||
<reference key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="IBUIView" id="566266441">
|
||||
<reference key="NSNextResponder" ref="766721923"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{284, 77}, {200, 200}}</string>
|
||||
<reference key="NSSuperview" ref="766721923"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="539434501"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:212</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
<object class="NSColorSpace" key="NSCustomColorSpace" id="553252529">
|
||||
<int key="NSID">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
<object class="IBUILabel" id="539434501">
|
||||
<reference key="NSNextResponder" ref="766721923"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{240, 285}, {288, 21}}</string>
|
||||
<reference key="NSSuperview" ref="766721923"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="323571472"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:345</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<string key="IBUIText"/>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
<string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<int key="IBUITextAlignment">1</int>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription">
|
||||
<int key="type">1</int>
|
||||
<double key="pointSize">17</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">HelveticaNeue</string>
|
||||
<double key="NSSize">17</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUIButton" id="323571472">
|
||||
<reference key="NSNextResponder" ref="766721923"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{92, 340}, {288, 37}}</string>
|
||||
<reference key="NSSuperview" ref="766721923"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="777937896"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<object class="NSColor" key="IBUINormalTitleColor" id="963949535">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUIHighlightedTitleColor" id="380594171">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
<string key="IBUINormalTitle">Post Status Update</string>
|
||||
<object class="NSColor" key="IBUIDisabledTitleColor" id="248341095">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleShadowColor" id="462923118">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription" id="41516072">
|
||||
<int key="type">2</int>
|
||||
<double key="pointSize">15</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont" id="701288525">
|
||||
<string key="NSName">HelveticaNeue-Bold</string>
|
||||
<double key="NSSize">15</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUIButton" id="777937896">
|
||||
<reference key="NSNextResponder" ref="766721923"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{388, 340}, {288, 37}}</string>
|
||||
<reference key="NSSuperview" ref="766721923"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="251662012"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<reference key="IBUINormalTitleColor" ref="963949535"/>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="380594171"/>
|
||||
<string key="IBUINormalTitle">Post Photo</string>
|
||||
<reference key="IBUIDisabledTitleColor" ref="248341095"/>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="462923118"/>
|
||||
<reference key="IBUIFontDescription" ref="41516072"/>
|
||||
<reference key="IBUIFont" ref="701288525"/>
|
||||
</object>
|
||||
<object class="IBUIButton" id="251662012">
|
||||
<reference key="NSNextResponder" ref="766721923"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{92, 385}, {288, 37}}</string>
|
||||
<reference key="NSSuperview" ref="766721923"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="463337385"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<reference key="IBUINormalTitleColor" ref="963949535"/>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="380594171"/>
|
||||
<string key="IBUINormalTitle">Pick Some Friends</string>
|
||||
<reference key="IBUIDisabledTitleColor" ref="248341095"/>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="462923118"/>
|
||||
<reference key="IBUIFontDescription" ref="41516072"/>
|
||||
<reference key="IBUIFont" ref="701288525"/>
|
||||
</object>
|
||||
<object class="IBUIButton" id="463337385">
|
||||
<reference key="NSNextResponder" ref="766721923"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{388, 385}, {288, 37}}</string>
|
||||
<reference key="NSSuperview" ref="766721923"/>
|
||||
<reference key="NSWindow"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<reference key="IBUINormalTitleColor" ref="963949535"/>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="380594171"/>
|
||||
<string key="IBUINormalTitle">Pick Place</string>
|
||||
<reference key="IBUIDisabledTitleColor" ref="248341095"/>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="462923118"/>
|
||||
<reference key="IBUIFontDescription" ref="41516072"/>
|
||||
<reference key="IBUIFont" ref="701288525"/>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{0, 20}, {768, 1004}}</string>
|
||||
<reference key="NSSuperview"/>
|
||||
<reference key="NSWindow"/>
|
||||
<reference key="NSNextKeyView" ref="566266441"/>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
<reference key="NSCustomColorSpace" ref="553252529"/>
|
||||
</object>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics">
|
||||
<int key="IBUIStatusBarStyle">2</int>
|
||||
</object>
|
||||
<string key="targetRuntimeIdentifier">IBIPadFramework</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<bool key="usesAutoincrementingIDs">NO</bool>
|
||||
<array class="NSMutableArray" key="connectionRecords">
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="766721923"/>
|
||||
</object>
|
||||
<string key="id">3</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">profilePic</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="566266441"/>
|
||||
</object>
|
||||
<string key="id">15</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">labelFirstName</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="539434501"/>
|
||||
</object>
|
||||
<string key="id">19</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">buttonPostStatus</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="323571472"/>
|
||||
</object>
|
||||
<string key="id">26</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">buttonPostPhoto</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="777937896"/>
|
||||
</object>
|
||||
<string key="id">27</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">buttonPickFriends</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="251662012"/>
|
||||
</object>
|
||||
<string key="id">28</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">buttonPickPlace</string>
|
||||
<reference key="source" ref="841351856"/>
|
||||
<reference key="destination" ref="463337385"/>
|
||||
</object>
|
||||
<string key="id">35</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">postStatusUpdateClick:</string>
|
||||
<reference key="source" ref="323571472"/>
|
||||
<reference key="destination" ref="841351856"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<string key="id">23</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">postPhotoClick:</string>
|
||||
<reference key="source" ref="777937896"/>
|
||||
<reference key="destination" ref="841351856"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<string key="id">24</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">pickFriendsClick:</string>
|
||||
<reference key="source" ref="251662012"/>
|
||||
<reference key="destination" ref="841351856"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<string key="id">29</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">pickPlaceClick:</string>
|
||||
<reference key="source" ref="463337385"/>
|
||||
<reference key="destination" ref="841351856"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<string key="id">34</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">0</string>
|
||||
<array key="object" id="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">-1</string>
|
||||
<reference key="object" ref="841351856"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">-2</string>
|
||||
<reference key="object" ref="606714003"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">2</string>
|
||||
<reference key="object" ref="766721923"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="539434501"/>
|
||||
<reference ref="566266441"/>
|
||||
<reference ref="323571472"/>
|
||||
<reference ref="777937896"/>
|
||||
<reference ref="251662012"/>
|
||||
<reference ref="463337385"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">13</string>
|
||||
<reference key="object" ref="566266441"/>
|
||||
<reference key="parent" ref="766721923"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">18</string>
|
||||
<reference key="object" ref="539434501"/>
|
||||
<reference key="parent" ref="766721923"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">20</string>
|
||||
<reference key="object" ref="323571472"/>
|
||||
<reference key="parent" ref="766721923"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">21</string>
|
||||
<reference key="object" ref="777937896"/>
|
||||
<reference key="parent" ref="766721923"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">22</string>
|
||||
<reference key="object" ref="251662012"/>
|
||||
<reference key="parent" ref="766721923"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">32</string>
|
||||
<reference key="object" ref="463337385"/>
|
||||
<reference key="parent" ref="766721923"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
<string key="-1.CustomClassName">HFViewController</string>
|
||||
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="-2.CustomClassName">UIResponder</string>
|
||||
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="13.CustomClassName">FBProfilePictureView</string>
|
||||
<string key="13.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="18.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="20.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<real value="3" key="20.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
|
||||
<string key="21.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<real value="3" key="21.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
|
||||
<string key="22.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<real value="3" key="22.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
|
||||
<string key="32.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<real value="3" key="32.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes">
|
||||
<array class="NSMutableArray" key="referencedPartialClassDescriptions">
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">FBProfilePictureView</string>
|
||||
<string key="superclassName">UIView</string>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/FBProfilePictureView.h</string>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBPartialClassDescription">
|
||||
<string key="className">HFViewController</string>
|
||||
<string key="superclassName">UIViewController</string>
|
||||
<dictionary class="NSMutableDictionary" key="actions">
|
||||
<string key="pickFriendsClick:">UIButton</string>
|
||||
<string key="pickPlaceClick:">UIButton</string>
|
||||
<string key="postPhotoClick:">UIButton</string>
|
||||
<string key="postStatusUpdateClick:">UIButton</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="actionInfosByName">
|
||||
<object class="IBActionInfo" key="pickFriendsClick:">
|
||||
<string key="name">pickFriendsClick:</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
<object class="IBActionInfo" key="pickPlaceClick:">
|
||||
<string key="name">pickPlaceClick:</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
<object class="IBActionInfo" key="postPhotoClick:">
|
||||
<string key="name">postPhotoClick:</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
<object class="IBActionInfo" key="postStatusUpdateClick:">
|
||||
<string key="name">postStatusUpdateClick:</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="outlets">
|
||||
<string key="buttonPickFriends">UIButton</string>
|
||||
<string key="buttonPickPlace">UIButton</string>
|
||||
<string key="buttonPostPhoto">UIButton</string>
|
||||
<string key="buttonPostStatus">UIButton</string>
|
||||
<string key="labelFirstName">UILabel</string>
|
||||
<string key="profilePic">FBProfilePictureView</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="toOneOutletInfosByName">
|
||||
<object class="IBToOneOutletInfo" key="buttonPickFriends">
|
||||
<string key="name">buttonPickFriends</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="buttonPickPlace">
|
||||
<string key="name">buttonPickPlace</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="buttonPostPhoto">
|
||||
<string key="name">buttonPostPhoto</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="buttonPostStatus">
|
||||
<string key="name">buttonPostStatus</string>
|
||||
<string key="candidateClassName">UIButton</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="labelFirstName">
|
||||
<string key="name">labelFirstName</string>
|
||||
<string key="candidateClassName">UILabel</string>
|
||||
</object>
|
||||
<object class="IBToOneOutletInfo" key="profilePic">
|
||||
<string key="name">profilePic</string>
|
||||
<string key="candidateClassName">FBProfilePictureView</string>
|
||||
</object>
|
||||
</dictionary>
|
||||
<object class="IBClassDescriptionSource" key="sourceIdentifier">
|
||||
<string key="majorKey">IBProjectSource</string>
|
||||
<string key="minorKey">./Classes/HFViewController.h</string>
|
||||
</object>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBIPadFramework</string>
|
||||
<bool key="IBDocument.previouslyAttemptedUpgradeToXcode5">YES</bool>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<real value="1280" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="4600" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">3734.1</string>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -1,394 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<archive type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="8.00">
|
||||
<data>
|
||||
<int key="IBDocument.SystemTarget">1280</int>
|
||||
<string key="IBDocument.SystemVersion">12E55</string>
|
||||
<string key="IBDocument.InterfaceBuilderVersion">4504</string>
|
||||
<string key="IBDocument.AppKitVersion">1187.39</string>
|
||||
<string key="IBDocument.HIToolboxVersion">626.00</string>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginVersions">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="NS.object.0">3734.1</string>
|
||||
</object>
|
||||
<array key="IBDocument.IntegratedClassDependencies">
|
||||
<string>IBProxyObject</string>
|
||||
<string>IBUIButton</string>
|
||||
<string>IBUILabel</string>
|
||||
<string>IBUIView</string>
|
||||
</array>
|
||||
<array key="IBDocument.PluginDependencies">
|
||||
<string>com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</array>
|
||||
<object class="NSMutableDictionary" key="IBDocument.Metadata">
|
||||
<string key="NS.key.0">PluginDependencyRecalculationVersion</string>
|
||||
<integer value="1" key="NS.object.0"/>
|
||||
</object>
|
||||
<array class="NSMutableArray" key="IBDocument.RootObjects" id="1000">
|
||||
<object class="IBProxyObject" id="372490531">
|
||||
<string key="IBProxiedObjectIdentifier">IBFilesOwner</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBProxyObject" id="843779117">
|
||||
<string key="IBProxiedObjectIdentifier">IBFirstResponder</string>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIView" id="774585933">
|
||||
<nil key="NSNextResponder"/>
|
||||
<int key="NSvFlags">274</int>
|
||||
<array class="NSMutableArray" key="NSSubviews">
|
||||
<object class="IBUILabel" id="779248524">
|
||||
<reference key="NSNextResponder" ref="774585933"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{90, 72}, {140, 39}}</string>
|
||||
<reference key="NSSuperview" ref="774585933"/>
|
||||
<reference key="NSNextKeyView" ref="876670607"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:328</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<bool key="IBUIClipsSubviews">YES</bool>
|
||||
<int key="IBUIContentMode">7</int>
|
||||
<bool key="IBUIUserInteractionEnabled">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<string key="IBUIText"/>
|
||||
<object class="NSColor" key="IBUITextColor">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MCAwIDAAA</bytes>
|
||||
<string key="IBUIColorCocoaTouchKeyPath">darkTextColor</string>
|
||||
</object>
|
||||
<nil key="IBUIHighlightedColor"/>
|
||||
<int key="IBUIBaselineAdjustment">1</int>
|
||||
<float key="IBUIMinimumFontSize">10</float>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription">
|
||||
<int key="type">1</int>
|
||||
<double key="pointSize">17</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont">
|
||||
<string key="NSName">HelveticaNeue</string>
|
||||
<double key="NSSize">17</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUIView" id="876670607">
|
||||
<reference key="NSNextResponder" ref="774585933"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{95, 122}, {130, 130}}</string>
|
||||
<reference key="NSSuperview" ref="774585933"/>
|
||||
<reference key="NSNextKeyView" ref="743807717"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:196</string>
|
||||
<object class="NSColor" key="IBUIBackgroundColor">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
<object class="NSColorSpace" key="NSCustomColorSpace">
|
||||
<int key="NSID">2</int>
|
||||
</object>
|
||||
</object>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
<object class="IBUIButton" id="743807717">
|
||||
<reference key="NSNextResponder" ref="774585933"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 274}, {280, 37}}</string>
|
||||
<reference key="NSSuperview" ref="774585933"/>
|
||||
<reference key="NSNextKeyView" ref="802923271"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<object class="NSColor" key="IBUINormalTitleColor" id="1056934299">
|
||||
<int key="NSColorSpace">1</int>
|
||||
<bytes key="NSRGB">MC4xOTYwNzg0MzE0IDAuMzA5ODAzOTIxNiAwLjUyMTU2ODYyNzUAA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUIHighlightedTitleColor" id="850175821">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MQA</bytes>
|
||||
</object>
|
||||
<string key="IBUINormalTitle">Post Status Update</string>
|
||||
<object class="NSColor" key="IBUIDisabledTitleColor" id="694029810">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC42NjY2NjY2NjY3AA</bytes>
|
||||
</object>
|
||||
<object class="NSColor" key="IBUINormalTitleShadowColor" id="586080074">
|
||||
<int key="NSColorSpace">3</int>
|
||||
<bytes key="NSWhite">MC41AA</bytes>
|
||||
</object>
|
||||
<object class="IBUIFontDescription" key="IBUIFontDescription" id="779712432">
|
||||
<int key="type">2</int>
|
||||
<double key="pointSize">15</double>
|
||||
</object>
|
||||
<object class="NSFont" key="IBUIFont" id="501697092">
|
||||
<string key="NSName">HelveticaNeue-Bold</string>
|
||||
<double key="NSSize">15</double>
|
||||
<int key="NSfFlags">16</int>
|
||||
</object>
|
||||
</object>
|
||||
<object class="IBUIButton" id="802923271">
|
||||
<reference key="NSNextResponder" ref="774585933"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 319}, {280, 37}}</string>
|
||||
<reference key="NSSuperview" ref="774585933"/>
|
||||
<reference key="NSNextKeyView" ref="895339881"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<reference key="IBUINormalTitleColor" ref="1056934299"/>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="850175821"/>
|
||||
<string key="IBUINormalTitle">Post Photo</string>
|
||||
<reference key="IBUIDisabledTitleColor" ref="694029810"/>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="586080074"/>
|
||||
<reference key="IBUIFontDescription" ref="779712432"/>
|
||||
<reference key="IBUIFont" ref="501697092"/>
|
||||
</object>
|
||||
<object class="IBUIButton" id="895339881">
|
||||
<reference key="NSNextResponder" ref="774585933"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 364}, {280, 37}}</string>
|
||||
<reference key="NSSuperview" ref="774585933"/>
|
||||
<reference key="NSNextKeyView" ref="921992193"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<reference key="IBUINormalTitleColor" ref="1056934299"/>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="850175821"/>
|
||||
<string key="IBUINormalTitle">Pick Some Friends</string>
|
||||
<reference key="IBUIDisabledTitleColor" ref="694029810"/>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="586080074"/>
|
||||
<reference key="IBUIFontDescription" ref="779712432"/>
|
||||
<reference key="IBUIFont" ref="501697092"/>
|
||||
</object>
|
||||
<object class="IBUIButton" id="921992193">
|
||||
<reference key="NSNextResponder" ref="774585933"/>
|
||||
<int key="NSvFlags">292</int>
|
||||
<string key="NSFrame">{{20, 409}, {280, 37}}</string>
|
||||
<reference key="NSSuperview" ref="774585933"/>
|
||||
<string key="NSReuseIdentifierKey">_NS:9</string>
|
||||
<bool key="IBUIOpaque">NO</bool>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<int key="IBUIContentHorizontalAlignment">0</int>
|
||||
<int key="IBUIContentVerticalAlignment">0</int>
|
||||
<int key="IBUIButtonType">1</int>
|
||||
<reference key="IBUINormalTitleColor" ref="1056934299"/>
|
||||
<reference key="IBUIHighlightedTitleColor" ref="850175821"/>
|
||||
<string key="IBUINormalTitle">Pick Place</string>
|
||||
<reference key="IBUIDisabledTitleColor" ref="694029810"/>
|
||||
<reference key="IBUINormalTitleShadowColor" ref="586080074"/>
|
||||
<reference key="IBUIFontDescription" ref="779712432"/>
|
||||
<reference key="IBUIFont" ref="501697092"/>
|
||||
</object>
|
||||
</array>
|
||||
<string key="NSFrame">{{0, 20}, {320, 460}}</string>
|
||||
<reference key="NSNextKeyView" ref="779248524"/>
|
||||
<reference key="IBUIBackgroundColor" ref="850175821"/>
|
||||
<bool key="IBUIClearsContextBeforeDrawing">NO</bool>
|
||||
<object class="IBUISimulatedStatusBarMetrics" key="IBUISimulatedStatusBarMetrics"/>
|
||||
<string key="targetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBObjectContainer" key="IBDocument.Objects">
|
||||
<bool key="usesAutoincrementingIDs">NO</bool>
|
||||
<array class="NSMutableArray" key="connectionRecords">
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">profilePic</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="876670607"/>
|
||||
</object>
|
||||
<string key="id">19</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">view</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="774585933"/>
|
||||
</object>
|
||||
<string key="id">23</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">buttonPostStatus</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="743807717"/>
|
||||
</object>
|
||||
<string key="id">28</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">buttonPostPhoto</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="802923271"/>
|
||||
</object>
|
||||
<string key="id">29</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">buttonPickFriends</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="895339881"/>
|
||||
</object>
|
||||
<string key="id">33</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">labelFirstName</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="779248524"/>
|
||||
</object>
|
||||
<string key="id">21</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchOutletConnection" key="connection">
|
||||
<string key="label">buttonPickPlace</string>
|
||||
<reference key="source" ref="372490531"/>
|
||||
<reference key="destination" ref="921992193"/>
|
||||
</object>
|
||||
<string key="id">39</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">postStatusUpdateClick:</string>
|
||||
<reference key="source" ref="743807717"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<string key="id">26</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">postPhotoClick:</string>
|
||||
<reference key="source" ref="802923271"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<string key="id">27</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">pickFriendsClick:</string>
|
||||
<reference key="source" ref="895339881"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<string key="id">34</string>
|
||||
</object>
|
||||
<object class="IBConnectionRecord">
|
||||
<object class="IBCocoaTouchEventConnection" key="connection">
|
||||
<string key="label">pickPlaceClick:</string>
|
||||
<reference key="source" ref="921992193"/>
|
||||
<reference key="destination" ref="372490531"/>
|
||||
<int key="IBEventType">7</int>
|
||||
</object>
|
||||
<string key="id">40</string>
|
||||
</object>
|
||||
</array>
|
||||
<object class="IBMutableOrderedSet" key="objectRecords">
|
||||
<array key="orderedObjects">
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">0</string>
|
||||
<array key="object" id="0"/>
|
||||
<reference key="children" ref="1000"/>
|
||||
<nil key="parent"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">-1</string>
|
||||
<reference key="object" ref="372490531"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
<string key="objectName">File's Owner</string>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">-2</string>
|
||||
<reference key="object" ref="843779117"/>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">6</string>
|
||||
<reference key="object" ref="774585933"/>
|
||||
<array class="NSMutableArray" key="children">
|
||||
<reference ref="743807717"/>
|
||||
<reference ref="802923271"/>
|
||||
<reference ref="895339881"/>
|
||||
<reference ref="876670607"/>
|
||||
<reference ref="779248524"/>
|
||||
<reference ref="921992193"/>
|
||||
</array>
|
||||
<reference key="parent" ref="0"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">18</string>
|
||||
<reference key="object" ref="876670607"/>
|
||||
<array class="NSMutableArray" key="children"/>
|
||||
<reference key="parent" ref="774585933"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">24</string>
|
||||
<reference key="object" ref="743807717"/>
|
||||
<reference key="parent" ref="774585933"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">25</string>
|
||||
<reference key="object" ref="802923271"/>
|
||||
<reference key="parent" ref="774585933"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">30</string>
|
||||
<reference key="object" ref="895339881"/>
|
||||
<reference key="parent" ref="774585933"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">17</string>
|
||||
<reference key="object" ref="779248524"/>
|
||||
<reference key="parent" ref="774585933"/>
|
||||
</object>
|
||||
<object class="IBObjectRecord">
|
||||
<string key="id">37</string>
|
||||
<reference key="object" ref="921992193"/>
|
||||
<reference key="parent" ref="774585933"/>
|
||||
</object>
|
||||
</array>
|
||||
</object>
|
||||
<dictionary class="NSMutableDictionary" key="flattenedProperties">
|
||||
<string key="-1.CustomClassName">HFViewController</string>
|
||||
<string key="-1.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="-2.CustomClassName">UIResponder</string>
|
||||
<string key="-2.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="17.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="18.CustomClassName">FBProfilePictureView</string>
|
||||
<string key="18.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<string key="24.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<real value="0.0" key="24.IBUIButtonInspectorSelectedEdgeInsetMetadataKey"/>
|
||||
<real value="0.0" key="24.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
|
||||
<string key="25.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<real value="3" key="25.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
|
||||
<string key="30.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<real value="3" key="30.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
|
||||
<string key="37.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
<real value="3" key="37.IBUIButtonInspectorSelectedStateConfigurationMetadataKey"/>
|
||||
<string key="6.IBPluginDependency">com.apple.InterfaceBuilder.IBCocoaTouchPlugin</string>
|
||||
</dictionary>
|
||||
<dictionary class="NSMutableDictionary" key="unlocalizedProperties"/>
|
||||
<nil key="activeLocalization"/>
|
||||
<dictionary class="NSMutableDictionary" key="localizations"/>
|
||||
<nil key="sourceID"/>
|
||||
</object>
|
||||
<object class="IBClassDescriber" key="IBDocument.Classes"/>
|
||||
<int key="IBDocument.localizationMode">0</int>
|
||||
<string key="IBDocument.TargetRuntimeIdentifier">IBCocoaTouchFramework</string>
|
||||
<bool key="IBDocument.previouslyAttemptedUpgradeToXcode5">YES</bool>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDependencyDefaults">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.iPhoneOS</string>
|
||||
<real value="1280" key="NS.object.0"/>
|
||||
</object>
|
||||
<object class="NSMutableDictionary" key="IBDocument.PluginDeclaredDevelopmentDependencies">
|
||||
<string key="NS.key.0">com.apple.InterfaceBuilder.CocoaTouchPlugin.InterfaceBuilder3</string>
|
||||
<integer value="4600" key="NS.object.0"/>
|
||||
</object>
|
||||
<bool key="IBDocument.PluginDeclaredDependenciesTrackSystemTargetVersion">YES</bool>
|
||||
<int key="IBDocument.defaultPropertyAccessControl">3</int>
|
||||
<string key="IBCocoaTouchPluginVersion">3734.1</string>
|
||||
</data>
|
||||
</archive>
|
||||
@@ -1,2 +0,0 @@
|
||||
/* Localized versions of Info.plist keys */
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
/*
|
||||
* Copyright 2010-present Facebook.
|
||||
*
|
||||
* Licensed under the Apache License, Version 2.0 (the "License");
|
||||
* you may not use this file except in compliance with the License.
|
||||
* You may obtain a copy of the License at
|
||||
*
|
||||
* http://www.apache.org/licenses/LICENSE-2.0
|
||||
|
||||
* Unless required by applicable law or agreed to in writing, software
|
||||
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||
* See the License for the specific language governing permissions and
|
||||
* limitations under the License.
|
||||
*/
|
||||
|
||||
#import <UIKit/UIKit.h>
|
||||
|
||||
#import "HFAppDelegate.h"
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
@autoreleasepool {
|
||||
return UIApplicationMain(argc, argv, nil, NSStringFromClass([HFAppDelegate class]));
|
||||
}
|
||||
}
|
||||
@@ -1,12 +0,0 @@
|
||||
Hello Facebook sample
|
||||
|
||||
This sample demonstrates some basic usage of the Facebook SDK, including:
|
||||
- Using the FBLoginView class to display Login/Logout functionality.
|
||||
- Using the FBProfilePictureView to display a user's profile picture.
|
||||
- Using FBRequest to post a status update and a photo.
|
||||
- Using FBFriendPickerViewController to display the user's friends and let them select a set of friends.
|
||||
- Using FBPlacePickerViewController to display a list of nearby places and let the user select one
|
||||
|
||||
Using the Sample
|
||||
Install the Facebook SDK for iOS.
|
||||
Launch the HelloFacebookSample project using Xcode from the <Facebook SDK>/samples/HelloFacebookSample directory.
|
||||
@@ -1,351 +0,0 @@
|
||||
// !$*UTF8*$!
|
||||
{
|
||||
archiveVersion = 1;
|
||||
classes = {
|
||||
};
|
||||
objectVersion = 46;
|
||||
objects = {
|
||||
|
||||
/* Begin PBXBuildFile section */
|
||||
85AFB515158FA0A6000AF7F5 /* Icon-72.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB511158FA0A6000AF7F5 /* Icon-72.png */; };
|
||||
85AFB516158FA0A6000AF7F5 /* Icon-72@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB512158FA0A6000AF7F5 /* Icon-72@2x.png */; };
|
||||
85AFB517158FA0A6000AF7F5 /* Icon.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB513158FA0A6000AF7F5 /* Icon.png */; };
|
||||
85AFB518158FA0A6000AF7F5 /* Icon@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85AFB514158FA0A6000AF7F5 /* Icon@2x.png */; };
|
||||
85C69D9E1602B105008AD9A0 /* Default-568h@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69D9B1602B105008AD9A0 /* Default-568h@2x.png */; };
|
||||
85C69D9F1602B105008AD9A0 /* Default.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69D9C1602B105008AD9A0 /* Default.png */; };
|
||||
85C69DA01602B105008AD9A0 /* Default@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 85C69D9D1602B105008AD9A0 /* Default@2x.png */; };
|
||||
B9AF4BA9152E43EE00E9BA6C /* UIKit.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B9AF4BA8152E43EE00E9BA6C /* UIKit.framework */; };
|
||||
B9AF4BAB152E43EE00E9BA6C /* Foundation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B9AF4BAA152E43EE00E9BA6C /* Foundation.framework */; };
|
||||
B9AF4BAD152E43EE00E9BA6C /* CoreGraphics.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B9AF4BAC152E43EE00E9BA6C /* CoreGraphics.framework */; };
|
||||
B9AF4BB3152E43EE00E9BA6C /* InfoPlist.strings in Resources */ = {isa = PBXBuildFile; fileRef = B9AF4BB1152E43EE00E9BA6C /* InfoPlist.strings */; };
|
||||
B9AF4BB5152E43EE00E9BA6C /* main.m in Sources */ = {isa = PBXBuildFile; fileRef = B9AF4BB4152E43EE00E9BA6C /* main.m */; };
|
||||
B9AF4BB9152E43EE00E9BA6C /* PPAppDelegate.m in Sources */ = {isa = PBXBuildFile; fileRef = B9AF4BB8152E43EE00E9BA6C /* PPAppDelegate.m */; };
|
||||
B9AF4BBC152E43EE00E9BA6C /* PPViewController.m in Sources */ = {isa = PBXBuildFile; fileRef = B9AF4BBB152E43EE00E9BA6C /* PPViewController.m */; };
|
||||
B9AF4BBF152E43EE00E9BA6C /* PPViewController_iPhone.xib in Resources */ = {isa = PBXBuildFile; fileRef = B9AF4BBD152E43EE00E9BA6C /* PPViewController_iPhone.xib */; };
|
||||
B9AF4BC2152E43EE00E9BA6C /* PPViewController_iPad.xib in Resources */ = {isa = PBXBuildFile; fileRef = B9AF4BC0152E43EE00E9BA6C /* PPViewController_iPad.xib */; };
|
||||
B9AF4C37152E449300E9BA6C /* CoreLocation.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = B9AF4C36152E449300E9BA6C /* CoreLocation.framework */; };
|
||||
DD37EA7815ABA3E70015966B /* FacebookSDK.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = DD37EA7715ABA3E70015966B /* FacebookSDK.framework */; };
|
||||
/* End PBXBuildFile section */
|
||||
|
||||
/* Begin PBXFileReference section */
|
||||
85AFB511158FA0A6000AF7F5 /* Icon-72.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72.png"; sourceTree = "<group>"; };
|
||||
85AFB512158FA0A6000AF7F5 /* Icon-72@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon-72@2x.png"; sourceTree = "<group>"; };
|
||||
85AFB513158FA0A6000AF7F5 /* Icon.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Icon.png; sourceTree = "<group>"; };
|
||||
85AFB514158FA0A6000AF7F5 /* Icon@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Icon@2x.png"; sourceTree = "<group>"; };
|
||||
85C69D9B1602B105008AD9A0 /* Default-568h@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default-568h@2x.png"; sourceTree = "<group>"; };
|
||||
85C69D9C1602B105008AD9A0 /* Default.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = Default.png; sourceTree = "<group>"; };
|
||||
85C69D9D1602B105008AD9A0 /* Default@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = "Default@2x.png"; sourceTree = "<group>"; };
|
||||
B9AF4BA4152E43EE00E9BA6C /* PlacePickerSample.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = PlacePickerSample.app; sourceTree = BUILT_PRODUCTS_DIR; };
|
||||
B9AF4BA8152E43EE00E9BA6C /* UIKit.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = UIKit.framework; path = System/Library/Frameworks/UIKit.framework; sourceTree = SDKROOT; };
|
||||
B9AF4BAA152E43EE00E9BA6C /* Foundation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = Foundation.framework; path = System/Library/Frameworks/Foundation.framework; sourceTree = SDKROOT; };
|
||||
B9AF4BAC152E43EE00E9BA6C /* CoreGraphics.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreGraphics.framework; path = System/Library/Frameworks/CoreGraphics.framework; sourceTree = SDKROOT; };
|
||||
B9AF4BB0152E43EE00E9BA6C /* PlacePickerSample-Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = "PlacePickerSample-Info.plist"; sourceTree = "<group>"; };
|
||||
B9AF4BB2152E43EE00E9BA6C /* en */ = {isa = PBXFileReference; lastKnownFileType = text.plist.strings; name = en; path = en.lproj/InfoPlist.strings; sourceTree = "<group>"; };
|
||||
B9AF4BB4152E43EE00E9BA6C /* main.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = main.m; sourceTree = "<group>"; };
|
||||
B9AF4BB6152E43EE00E9BA6C /* PlacePickerSample-Prefix.pch */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = "PlacePickerSample-Prefix.pch"; sourceTree = "<group>"; };
|
||||
B9AF4BB7152E43EE00E9BA6C /* PPAppDelegate.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = PPAppDelegate.h; sourceTree = "<group>"; };
|
||||
B9AF4BB8152E43EE00E9BA6C /* PPAppDelegate.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; path = PPAppDelegate.m; sourceTree = "<group>"; };
|
||||
B9AF4BBA152E43EE00E9BA6C /* PPViewController.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; lineEnding = 0; path = PPViewController.h; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objcpp; };
|
||||
B9AF4BBB152E43EE00E9BA6C /* PPViewController.m */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.objc; lineEnding = 0; path = PPViewController.m; sourceTree = "<group>"; xcLanguageSpecificationIdentifier = xcode.lang.objc; };
|
||||
B9AF4BBE152E43EE00E9BA6C /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/PPViewController_iPhone.xib; sourceTree = "<group>"; };
|
||||
B9AF4BC1152E43EE00E9BA6C /* en */ = {isa = PBXFileReference; lastKnownFileType = file.xib; name = en; path = en.lproj/PPViewController_iPad.xib; sourceTree = "<group>"; };
|
||||
B9AF4C36152E449300E9BA6C /* CoreLocation.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = CoreLocation.framework; path = System/Library/Frameworks/CoreLocation.framework; sourceTree = SDKROOT; };
|
||||
DD37EA7715ABA3E70015966B /* FacebookSDK.framework */ = {isa = PBXFileReference; lastKnownFileType = wrapper.framework; name = FacebookSDK.framework; path = ../../build/FacebookSDK.framework; sourceTree = "<group>"; };
|
||||
/* End PBXFileReference section */
|
||||
|
||||
/* Begin PBXFrameworksBuildPhase section */
|
||||
B9AF4BA1152E43EE00E9BA6C /* Frameworks */ = {
|
||||
isa = PBXFrameworksBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
B9AF4C37152E449300E9BA6C /* CoreLocation.framework in Frameworks */,
|
||||
B9AF4BA9152E43EE00E9BA6C /* UIKit.framework in Frameworks */,
|
||||
B9AF4BAB152E43EE00E9BA6C /* Foundation.framework in Frameworks */,
|
||||
B9AF4BAD152E43EE00E9BA6C /* CoreGraphics.framework in Frameworks */,
|
||||
DD37EA7815ABA3E70015966B /* FacebookSDK.framework in Frameworks */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXFrameworksBuildPhase section */
|
||||
|
||||
/* Begin PBXGroup section */
|
||||
B9AF4B99152E43EE00E9BA6C = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B9AF4BAE152E43EE00E9BA6C /* PlacePickerSample */,
|
||||
B9AF4BA7152E43EE00E9BA6C /* Frameworks */,
|
||||
B9AF4BA5152E43EE00E9BA6C /* Products */,
|
||||
);
|
||||
indentWidth = 4;
|
||||
sourceTree = "<group>";
|
||||
tabWidth = 4;
|
||||
};
|
||||
B9AF4BA5152E43EE00E9BA6C /* Products */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B9AF4BA4152E43EE00E9BA6C /* PlacePickerSample.app */,
|
||||
);
|
||||
name = Products;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B9AF4BA7152E43EE00E9BA6C /* Frameworks */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
DD37EA7715ABA3E70015966B /* FacebookSDK.framework */,
|
||||
B9AF4C36152E449300E9BA6C /* CoreLocation.framework */,
|
||||
B9AF4BA8152E43EE00E9BA6C /* UIKit.framework */,
|
||||
B9AF4BAA152E43EE00E9BA6C /* Foundation.framework */,
|
||||
B9AF4BAC152E43EE00E9BA6C /* CoreGraphics.framework */,
|
||||
);
|
||||
name = Frameworks;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B9AF4BAE152E43EE00E9BA6C /* PlacePickerSample */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
B9AF4BB7152E43EE00E9BA6C /* PPAppDelegate.h */,
|
||||
B9AF4BB8152E43EE00E9BA6C /* PPAppDelegate.m */,
|
||||
B9AF4BBA152E43EE00E9BA6C /* PPViewController.h */,
|
||||
B9AF4BBB152E43EE00E9BA6C /* PPViewController.m */,
|
||||
B9AF4BBD152E43EE00E9BA6C /* PPViewController_iPhone.xib */,
|
||||
B9AF4BC0152E43EE00E9BA6C /* PPViewController_iPad.xib */,
|
||||
B9AF4BAF152E43EE00E9BA6C /* Supporting Files */,
|
||||
);
|
||||
path = PlacePickerSample;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B9AF4BAF152E43EE00E9BA6C /* Supporting Files */ = {
|
||||
isa = PBXGroup;
|
||||
children = (
|
||||
85C69D9B1602B105008AD9A0 /* Default-568h@2x.png */,
|
||||
85C69D9C1602B105008AD9A0 /* Default.png */,
|
||||
85C69D9D1602B105008AD9A0 /* Default@2x.png */,
|
||||
85AFB511158FA0A6000AF7F5 /* Icon-72.png */,
|
||||
85AFB512158FA0A6000AF7F5 /* Icon-72@2x.png */,
|
||||
85AFB513158FA0A6000AF7F5 /* Icon.png */,
|
||||
85AFB514158FA0A6000AF7F5 /* Icon@2x.png */,
|
||||
B9AF4BB0152E43EE00E9BA6C /* PlacePickerSample-Info.plist */,
|
||||
B9AF4BB1152E43EE00E9BA6C /* InfoPlist.strings */,
|
||||
B9AF4BB4152E43EE00E9BA6C /* main.m */,
|
||||
B9AF4BB6152E43EE00E9BA6C /* PlacePickerSample-Prefix.pch */,
|
||||
);
|
||||
name = "Supporting Files";
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXGroup section */
|
||||
|
||||
/* Begin PBXNativeTarget section */
|
||||
B9AF4BA3152E43EE00E9BA6C /* PlacePickerSample */ = {
|
||||
isa = PBXNativeTarget;
|
||||
buildConfigurationList = B9AF4BC5152E43EE00E9BA6C /* Build configuration list for PBXNativeTarget "PlacePickerSample" */;
|
||||
buildPhases = (
|
||||
B9AF4BA0152E43EE00E9BA6C /* Sources */,
|
||||
B9AF4BA1152E43EE00E9BA6C /* Frameworks */,
|
||||
B9AF4BA2152E43EE00E9BA6C /* Resources */,
|
||||
);
|
||||
buildRules = (
|
||||
);
|
||||
dependencies = (
|
||||
);
|
||||
name = PlacePickerSample;
|
||||
productName = PlacePickerSample;
|
||||
productReference = B9AF4BA4152E43EE00E9BA6C /* PlacePickerSample.app */;
|
||||
productType = "com.apple.product-type.application";
|
||||
};
|
||||
/* End PBXNativeTarget section */
|
||||
|
||||
/* Begin PBXProject section */
|
||||
B9AF4B9B152E43EE00E9BA6C /* Project object */ = {
|
||||
isa = PBXProject;
|
||||
attributes = {
|
||||
LastUpgradeCheck = 0430;
|
||||
};
|
||||
buildConfigurationList = B9AF4B9E152E43EE00E9BA6C /* Build configuration list for PBXProject "PlacePickerSample" */;
|
||||
compatibilityVersion = "Xcode 3.2";
|
||||
developmentRegion = English;
|
||||
hasScannedForEncodings = 0;
|
||||
knownRegions = (
|
||||
en,
|
||||
he,
|
||||
);
|
||||
mainGroup = B9AF4B99152E43EE00E9BA6C;
|
||||
productRefGroup = B9AF4BA5152E43EE00E9BA6C /* Products */;
|
||||
projectDirPath = "";
|
||||
projectRoot = "";
|
||||
targets = (
|
||||
B9AF4BA3152E43EE00E9BA6C /* PlacePickerSample */,
|
||||
);
|
||||
};
|
||||
/* End PBXProject section */
|
||||
|
||||
/* Begin PBXResourcesBuildPhase section */
|
||||
B9AF4BA2152E43EE00E9BA6C /* Resources */ = {
|
||||
isa = PBXResourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
B9AF4BB3152E43EE00E9BA6C /* InfoPlist.strings in Resources */,
|
||||
B9AF4BBF152E43EE00E9BA6C /* PPViewController_iPhone.xib in Resources */,
|
||||
B9AF4BC2152E43EE00E9BA6C /* PPViewController_iPad.xib in Resources */,
|
||||
85AFB515158FA0A6000AF7F5 /* Icon-72.png in Resources */,
|
||||
85AFB516158FA0A6000AF7F5 /* Icon-72@2x.png in Resources */,
|
||||
85AFB517158FA0A6000AF7F5 /* Icon.png in Resources */,
|
||||
85AFB518158FA0A6000AF7F5 /* Icon@2x.png in Resources */,
|
||||
85C69D9E1602B105008AD9A0 /* Default-568h@2x.png in Resources */,
|
||||
85C69D9F1602B105008AD9A0 /* Default.png in Resources */,
|
||||
85C69DA01602B105008AD9A0 /* Default@2x.png in Resources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXResourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXSourcesBuildPhase section */
|
||||
B9AF4BA0152E43EE00E9BA6C /* Sources */ = {
|
||||
isa = PBXSourcesBuildPhase;
|
||||
buildActionMask = 2147483647;
|
||||
files = (
|
||||
B9AF4BB5152E43EE00E9BA6C /* main.m in Sources */,
|
||||
B9AF4BB9152E43EE00E9BA6C /* PPAppDelegate.m in Sources */,
|
||||
B9AF4BBC152E43EE00E9BA6C /* PPViewController.m in Sources */,
|
||||
);
|
||||
runOnlyForDeploymentPostprocessing = 0;
|
||||
};
|
||||
/* End PBXSourcesBuildPhase section */
|
||||
|
||||
/* Begin PBXVariantGroup section */
|
||||
B9AF4BB1152E43EE00E9BA6C /* InfoPlist.strings */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
B9AF4BB2152E43EE00E9BA6C /* en */,
|
||||
);
|
||||
name = InfoPlist.strings;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B9AF4BBD152E43EE00E9BA6C /* PPViewController_iPhone.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
B9AF4BBE152E43EE00E9BA6C /* en */,
|
||||
);
|
||||
name = PPViewController_iPhone.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
B9AF4BC0152E43EE00E9BA6C /* PPViewController_iPad.xib */ = {
|
||||
isa = PBXVariantGroup;
|
||||
children = (
|
||||
B9AF4BC1152E43EE00E9BA6C /* en */,
|
||||
);
|
||||
name = PPViewController_iPad.xib;
|
||||
sourceTree = "<group>";
|
||||
};
|
||||
/* End PBXVariantGroup section */
|
||||
|
||||
/* Begin XCBuildConfiguration section */
|
||||
B9AF4BC3152E43EE00E9BA6C /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_OBJCPP_ARC_ABI = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = NO;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_DYNAMIC_NO_PIC = NO;
|
||||
GCC_OPTIMIZATION_LEVEL = 0;
|
||||
GCC_PREPROCESSOR_DEFINITIONS = (
|
||||
"DEBUG=1",
|
||||
"$(inherited)",
|
||||
);
|
||||
GCC_SYMBOLS_PRIVATE_EXTERN = NO;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
B9AF4BC4152E43EE00E9BA6C /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
ALWAYS_SEARCH_USER_PATHS = NO;
|
||||
ARCHS = "$(ARCHS_STANDARD_32_BIT)";
|
||||
CLANG_ENABLE_OBJC_ARC = YES;
|
||||
CLANG_WARN_OBJCPP_ARC_ABI = YES;
|
||||
"CODE_SIGN_IDENTITY[sdk=iphoneos*]" = "iPhone Developer";
|
||||
COPY_PHASE_STRIP = YES;
|
||||
GCC_C_LANGUAGE_STANDARD = gnu99;
|
||||
GCC_VERSION = com.apple.compilers.llvm.clang.1_0;
|
||||
GCC_WARN_ABOUT_RETURN_TYPE = YES;
|
||||
GCC_WARN_UNINITIALIZED_AUTOS = YES;
|
||||
GCC_WARN_UNUSED_VARIABLE = YES;
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_CFLAGS = "-DNS_BLOCK_ASSERTIONS=1";
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
SDKROOT = iphoneos;
|
||||
TARGETED_DEVICE_FAMILY = "1,2";
|
||||
VALIDATE_PRODUCT = YES;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
B9AF4BC6152E43EE00E9BA6C /* Debug */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/../../build\"",
|
||||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "PlacePickerSample/PlacePickerSample-Prefix.pch";
|
||||
INFOPLIST_FILE = "PlacePickerSample/PlacePickerSample-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Debug;
|
||||
};
|
||||
B9AF4BC7152E43EE00E9BA6C /* Release */ = {
|
||||
isa = XCBuildConfiguration;
|
||||
buildSettings = {
|
||||
FRAMEWORK_SEARCH_PATHS = (
|
||||
"$(inherited)",
|
||||
"\"$(SRCROOT)/../../build\"",
|
||||
);
|
||||
GCC_PRECOMPILE_PREFIX_HEADER = YES;
|
||||
GCC_PREFIX_HEADER = "PlacePickerSample/PlacePickerSample-Prefix.pch";
|
||||
INFOPLIST_FILE = "PlacePickerSample/PlacePickerSample-Info.plist";
|
||||
IPHONEOS_DEPLOYMENT_TARGET = 5.0;
|
||||
OTHER_LDFLAGS = "-ObjC";
|
||||
PRODUCT_NAME = "$(TARGET_NAME)";
|
||||
WRAPPER_EXTENSION = app;
|
||||
};
|
||||
name = Release;
|
||||
};
|
||||
/* End XCBuildConfiguration section */
|
||||
|
||||
/* Begin XCConfigurationList section */
|
||||
B9AF4B9E152E43EE00E9BA6C /* Build configuration list for PBXProject "PlacePickerSample" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
B9AF4BC3152E43EE00E9BA6C /* Debug */,
|
||||
B9AF4BC4152E43EE00E9BA6C /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
B9AF4BC5152E43EE00E9BA6C /* Build configuration list for PBXNativeTarget "PlacePickerSample" */ = {
|
||||
isa = XCConfigurationList;
|
||||
buildConfigurations = (
|
||||
B9AF4BC6152E43EE00E9BA6C /* Debug */,
|
||||
B9AF4BC7152E43EE00E9BA6C /* Release */,
|
||||
);
|
||||
defaultConfigurationIsVisible = 0;
|
||||
defaultConfigurationName = Release;
|
||||
};
|
||||
/* End XCConfigurationList section */
|
||||
};
|
||||
rootObject = B9AF4B9B152E43EE00E9BA6C /* Project object */;
|
||||
}
|
||||
|
Before Width: | Height: | Size: 18 KiB |
|
Before Width: | Height: | Size: 6.4 KiB |
|
Before Width: | Height: | Size: 16 KiB |
|
Before Width: | Height: | Size: 12 KiB |
|
Before Width: | Height: | Size: 26 KiB |
|
Before Width: | Height: | Size: 9.5 KiB |