-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
162 changed files
with
8,568 additions
and
1,716 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
2 changes: 1 addition & 1 deletion
2
...ject.xcworkspace/contents.xcworkspacedata → ...ject.xcworkspace/contents.xcworkspacedata
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
41 changes: 41 additions & 0 deletions
41
BrowseOverflow.xcodeproj/project.xcworkspace/xcshareddata/BrowseOverflow.xccheckout
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
<?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>IDESourceControlProjectFavoriteDictionaryKey</key> | ||
<false/> | ||
<key>IDESourceControlProjectIdentifier</key> | ||
<string>07497CA6-4DBB-449E-815C-CB5DD836DB60</string> | ||
<key>IDESourceControlProjectName</key> | ||
<string>BrowseOverflow</string> | ||
<key>IDESourceControlProjectOriginsDictionary</key> | ||
<dict> | ||
<key>61D4D9A926E395FC3194AD1BDD818A1CD74DDBC2</key> | ||
<string>ssh://github.com/iamleeg/BrowseOverflow.git</string> | ||
</dict> | ||
<key>IDESourceControlProjectPath</key> | ||
<string>BrowseOverflow.xcodeproj/project.xcworkspace</string> | ||
<key>IDESourceControlProjectRelativeInstallPathDictionary</key> | ||
<dict> | ||
<key>61D4D9A926E395FC3194AD1BDD818A1CD74DDBC2</key> | ||
<string>../..</string> | ||
</dict> | ||
<key>IDESourceControlProjectURL</key> | ||
<string>ssh://github.com/iamleeg/BrowseOverflow.git</string> | ||
<key>IDESourceControlProjectVersion</key> | ||
<integer>111</integer> | ||
<key>IDESourceControlProjectWCCIdentifier</key> | ||
<string>61D4D9A926E395FC3194AD1BDD818A1CD74DDBC2</string> | ||
<key>IDESourceControlProjectWCConfigurations</key> | ||
<array> | ||
<dict> | ||
<key>IDESourceControlRepositoryExtensionIdentifierKey</key> | ||
<string>public.vcs.git</string> | ||
<key>IDESourceControlWCCIdentifierKey</key> | ||
<string>61D4D9A926E395FC3194AD1BDD818A1CD74DDBC2</string> | ||
<key>IDESourceControlWCCName</key> | ||
<string>BrowseOverflow</string> | ||
</dict> | ||
</array> | ||
</dict> | ||
</plist> |
Binary file added
BIN
+40.7 KB
....xcodeproj/project.xcworkspace/xcuserdata/leeg.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
10 changes: 10 additions & 0 deletions
10
...ow.xcodeproj/project.xcworkspace/xcuserdata/leeg.xcuserdatad/WorkspaceSettings.xcsettings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
<?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>HasAskedToTakeAutomaticSnapshotBeforeSignificantChanges</key> | ||
<true/> | ||
<key>SnapshotAutomaticallyBeforeSignificantChanges</key> | ||
<true/> | ||
</dict> | ||
</plist> |
Binary file added
BIN
+18.2 KB
...codeproj/project.xcworkspace/xcuserdata/sanlen.xcuserdatad/UserInterfaceState.xcuserstate
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 5 additions & 0 deletions
5
BrowseOverflow.xcodeproj/xcuserdata/leeg.xcuserdatad/xcdebugger/Breakpoints_v2.xcbkptlist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<Bucket | ||
type = "1" | ||
version = "2.0"> | ||
</Bucket> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
19 changes: 19 additions & 0 deletions
19
BrowseOverflow.xcodeproj/xcuserdata/sanlen.xcuserdatad/xcschemes/xcschememanagement.plist
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<?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>SuppressBuildableAutocreation</key> | ||
<dict> | ||
<key>98A548CA130D3ABC003C4F0F</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
<key>98A548EE130D3ABF003C4F0F</key> | ||
<dict> | ||
<key>primary</key> | ||
<true/> | ||
</dict> | ||
</dict> | ||
</dict> | ||
</plist> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// | ||
// Answer.h | ||
// BrowseOverflow | ||
// | ||
// Created by Graham J Lee on 25/02/2011. | ||
// Copyright 2011 Fuzzy Aliens Ltd. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
@class Person; | ||
|
||
@interface Answer : NSObject { | ||
|
||
} | ||
|
||
@property (copy) NSString *text; | ||
@property (retain) Person *person; | ||
@property (getter=isAccepted) BOOL accepted; | ||
@property NSInteger score; | ||
|
||
- (NSComparisonResult)compare: (Answer *)otherAnswer; | ||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
// | ||
// Answer.m | ||
// BrowseOverflow | ||
// | ||
// Created by Graham J Lee on 25/02/2011. | ||
// Copyright 2011 Fuzzy Aliens Ltd. All rights reserved. | ||
// | ||
|
||
#import "Answer.h" | ||
#import "Person.h" | ||
|
||
@implementation Answer | ||
|
||
@synthesize text; | ||
@synthesize person; | ||
@synthesize accepted; | ||
@synthesize score; | ||
|
||
- (NSComparisonResult)compare:(Answer *)otherAnswer { | ||
if (accepted && !(otherAnswer.accepted)) { | ||
return NSOrderedAscending; | ||
} else if (!accepted && otherAnswer.accepted){ | ||
return NSOrderedDescending; | ||
} | ||
if (score > otherAnswer.score) { | ||
return NSOrderedAscending; | ||
} else if (score < otherAnswer.score) { | ||
return NSOrderedDescending; | ||
} else { | ||
return NSOrderedSame; | ||
} | ||
} | ||
|
||
|
||
@end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
// | ||
// AnswerBuilder.h | ||
// BrowseOverflow | ||
// | ||
// Created by Graham Lee on 25/04/2011. | ||
// Copyright 2011 Fuzzy Aliens Ltd. All rights reserved. | ||
// | ||
|
||
#import <Foundation/Foundation.h> | ||
|
||
@class Question; | ||
|
||
/** | ||
* Constructing Answer objects from data sent by the Stack Overflow site. | ||
* @see Answer | ||
*/ | ||
@interface AnswerBuilder : NSObject { | ||
|
||
} | ||
|
||
/** | ||
* Populate a question object with the answers | ||
* supplied by the Stack Overflow web service. | ||
* @param question The question to which answers are required. | ||
* @param objectNotation The data containing the answer content. | ||
* @param error A by-reference error return. | ||
* @return YES if answers are successfully parsed, otherwise NO and error is filled to describe the problem. | ||
* @note If the data is valid but there are no answers to add, this is not an error. | ||
*/ | ||
- (BOOL)addAnswersToQuestion: (Question *)question fromJSON: (NSString *)objectNotation error: (NSError **)error; | ||
|
||
@end | ||
|
||
extern NSString *AnswerBuilderErrorDomain; | ||
|
||
enum { | ||
AnswerBuilderErrorInvalidJSONError, | ||
AnswerBuilderErrorMissingDataError, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// | ||
// AnswerBuilder.m | ||
// BrowseOverflow | ||
// | ||
// Created by Graham Lee on 25/04/2011. | ||
// Copyright 2011 Fuzzy Aliens Ltd. All rights reserved. | ||
// | ||
|
||
#import "AnswerBuilder.h" | ||
#import "Answer.h" | ||
#import "Question.h" | ||
#import "UserBuilder.h" | ||
|
||
@implementation AnswerBuilder | ||
|
||
- (BOOL)addAnswersToQuestion: (Question *)question fromJSON: (NSString *)objectNotation error: (NSError **)error { | ||
NSParameterAssert(objectNotation != nil); | ||
NSParameterAssert(question != nil); | ||
NSData *unicodeNotation = [objectNotation dataUsingEncoding: NSUTF8StringEncoding]; | ||
NSError *localError = nil; | ||
NSDictionary *answerData = [NSJSONSerialization JSONObjectWithData: unicodeNotation options: 0 error: &localError]; | ||
if (answerData == nil) { | ||
if (error) { | ||
NSMutableDictionary *userInfo = [NSMutableDictionary dictionaryWithCapacity: 1]; | ||
if (localError != nil) { | ||
[userInfo setObject: localError forKey: NSUnderlyingErrorKey]; | ||
} | ||
*error = [NSError errorWithDomain: AnswerBuilderErrorDomain code: AnswerBuilderErrorInvalidJSONError userInfo: userInfo]; | ||
} | ||
return NO; | ||
} | ||
|
||
NSArray *answers = [answerData objectForKey: @"answers"]; | ||
if (answers == nil) { | ||
if (error) { | ||
*error = [NSError errorWithDomain: AnswerBuilderErrorDomain code:AnswerBuilderErrorMissingDataError userInfo: nil]; | ||
} | ||
return NO; | ||
} | ||
|
||
for (NSDictionary *answerData in answers) { | ||
Answer *thisAnswer = [[Answer alloc] init]; | ||
thisAnswer.text = [answerData objectForKey: @"body"]; | ||
thisAnswer.accepted = [[answerData objectForKey: @"accepted"] boolValue]; | ||
thisAnswer.score = [[answerData objectForKey: @"score"] integerValue]; | ||
NSDictionary *ownerData = [answerData objectForKey: @"owner"]; | ||
thisAnswer.person = [UserBuilder personFromDictionary: ownerData]; | ||
[question addAnswer: thisAnswer]; | ||
} | ||
return YES; | ||
} | ||
|
||
@end | ||
|
||
NSString *AnswerBuilderErrorDomain = @"AnswerBuilderErrorDomain"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
// | ||
// AnswerCell.h | ||
// BrowseOverflow | ||
// | ||
// Created by Graham Lee on 26/09/2011. | ||
// Copyright (c) 2011 Fuzzy Aliens Ltd. All rights reserved. | ||
// | ||
|
||
#import <UIKit/UIKit.h> | ||
|
||
@interface AnswerCell : UITableViewCell | ||
|
||
@property (nonatomic, weak) IBOutlet UILabel *scoreLabel; | ||
@property (nonatomic, weak) IBOutlet UILabel *acceptedIndicator; | ||
@property (nonatomic, weak) IBOutlet UILabel *personName; | ||
@property (nonatomic, weak) IBOutlet UIImageView *personAvatar; | ||
@property (nonatomic, weak) IBOutlet UIWebView *bodyWebView; | ||
|
||
@end |
Oops, something went wrong.