Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions Classes/Misc/ListeningDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
if (shoutIndex == 0) {
return [controller refreshButtonCell];
}

ShoutListCell *cell = (ShoutListCell *)[tableView dequeueReusableCellWithIdentifier: CELL_REUSE_ID];
if (cell == nil) {
cell = [[[ShoutListCell alloc] initWithFrame: CGRectZero reuseIdentifier: CELL_REUSE_ID] autorelease];
Expand Down Expand Up @@ -184,7 +184,7 @@ - (void) updateIcons {
NSLog(@" - thread: %@", thread);
for (Shout *shout in shouts) {
//CFAbsoluteTime startTime = CFAbsoluteTimeGetCurrent();
//UIImage *icon =
//UIImage *icon =
[shout icon];
//CFAbsoluteTime endTime = CFAbsoluteTimeGetCurrent();
//NSLog(@" - user: %@; place:%@; icon load time: %f", [shout username], [shout placeName], (endTime - startTime));
Expand Down
6 changes: 3 additions & 3 deletions Classes/Misc/PlacesDataSource.m
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CELL_REUSE_ID];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CELL_REUSE_ID] autorelease];

CGFloat nameX = NAME_MARGIN_HORIZONTAL;
CGFloat nameY = NAME_MARGIN_VERTICAL;
CGFloat nameWidth = (cell.contentView.frame.size.width * 0.8) - (NAME_MARGIN_HORIZONTAL * 1.5);
Expand Down Expand Up @@ -169,13 +169,13 @@ - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(N
[nameLabel setTextColor:[UIColor blackColor]];
}
[nameLabel setText:nameValue];

UILabel *distLabel = (UILabel *)[cell.contentView viewWithTag:TAG_DISTANCE];
//NSLog(@" - distLabel: %@", distLabel);
NSString *distValue = [NSString stringWithFormat:@"%1.0fm", ([[place distance] doubleValue] * 1000)];
//NSLog(@" - distValue: %@", distValue);
[distLabel setText:distValue];

return cell;
}

Expand Down
6 changes: 3 additions & 3 deletions Classes/Misc/ShizzupAppDelegate.m
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ - (void)applicationDidFinishLaunching:(UIApplication *)application {

// Attempt to load saved credentials
[self retrieveCredentials];

// Crash reporting stuff
PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter];
// Check if we previously crashed
Expand All @@ -82,7 +82,7 @@ - (void) handleCrashReport {
PLCrashReporter *crashReporter = [PLCrashReporter sharedReporter];
NSData *crashData;
NSError *error;

// Try loading the crash report
crashData = [crashReporter loadPendingCrashReportDataAndReturnError: &error];
if (crashData == nil) {
Expand Down Expand Up @@ -111,7 +111,7 @@ - (void) handleCrashReport {
//NSLog(@"JSON crash data: %@", [report JSONRepresentation]);
}
}

// Purge the report
//[crashReporter purgePendingCrashReport];
return;
Expand Down
2 changes: 1 addition & 1 deletion Classes/Model/PlaceListReceiver.m
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ - (void)connectionDidFinishLoading:(NSURLConnection *)connection {
[converter release];
//NSLog(@" filteredResponseText: %@", filteredResponseText);
NSDictionary *responseDictionary = [filteredResponseText JSONValue];

//NSLog(@" - responseDictionary: %@: %@", [responseDictionary class], responseDictionary);
NSDictionary *results = [responseDictionary valueForKey:@"results"];
//NSLog(@" - results: %@: %@", [results class], results);
Expand Down
12 changes: 6 additions & 6 deletions Classes/Model/ShizzowApiConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -22,20 +22,20 @@ - (NSURLConnection *) callUri:(NSString *)apiUriStub delegate:(id)delegate {

- (NSURLConnection *) callUri:(NSString *)apiUriStub usingMethod:(NSString *)method withDelegate:(id)delegate withBody:(NSString *)body {
//NSLog(@" - apiUriStub: %@", apiUriStub);

NSString *apiUrlString = [NSString stringWithFormat:@"%@%@", SHIZZOW_API_URL_PREFIX, apiUriStub];
//NSLog(@" - apiUrlString: %@", apiUrlString);

NSURL *apiUrl = [NSURL URLWithString:apiUrlString];
NSLog(@" - apiUrl: %@", apiUrl);

NSURLProtectionSpace *protectionSpace = [NSURLProtectionSpace alloc];
NSString *host = [apiUrl host];
NSInteger port = [[apiUrl port] integerValue];
NSString *scheme = [apiUrl scheme];
[protectionSpace initWithHost:host port:port protocol:scheme realm:nil authenticationMethod:nil];
//NSLog(@"protectionSpace: %@", protectionSpace);

NSMutableURLRequest *request = [[NSMutableURLRequest alloc] initWithURL: apiUrl];
[request setHTTPMethod: method];
NSLog(@" - method: %@", method);
Expand All @@ -50,7 +50,7 @@ - (NSURLConnection *) callUri:(NSString *)apiUriStub usingMethod:(NSString *)met
}
}
NSLog(@" request: %@", request);

// TODO: Find a better way around this! Would be ideal to detect the problem, prompt user before continuing, and allow only for the appropriate request; a la Safari's invalid-certificate handling.
@try {
[NSURLRequest setAllowsAnyHTTPSCertificate:YES forHost:[apiUrl host]];
Expand All @@ -62,7 +62,7 @@ - (NSURLConnection *) callUri:(NSString *)apiUriStub usingMethod:(NSString *)met
[self abort];
connection = [[NSURLConnection connectionWithRequest:request delegate:delegate] retain];
//NSLog(@" connection: %@", connection);

return connection;
}

Expand Down
2 changes: 1 addition & 1 deletion Classes/Model/Shout.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
NSNumber *shoutId;
IconCache *iconCache;
UIImage *icon;

// Start dictionary keys
NSString *address1;
NSString *address2;
Expand Down
8 changes: 4 additions & 4 deletions Classes/ShoutDetailController.h
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,9 @@
@property(nonatomic, retain) IBOutlet UILabel *personHandleLabel;
@property(nonatomic, retain) IBOutlet UILabel *personNameLabel;
@property(nonatomic, retain) IBOutlet UILabel *placeNameLabel;
//@property(nonatomic, retain) IBOutlet
//@property(nonatomic, retain) IBOutlet
//@property(nonatomic, retain) IBOutlet
//@property(nonatomic, retain) IBOutlet
//@property(nonatomic, retain) IBOutlet
//@property(nonatomic, retain) IBOutlet
//@property(nonatomic, retain) IBOutlet
//@property(nonatomic, retain) IBOutlet

@end
6 changes: 3 additions & 3 deletions Classes/UI/ABTableViewCell.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2008 Loren Brichter
//
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
Expand All @@ -8,10 +8,10 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Expand Down
6 changes: 3 additions & 3 deletions Classes/UI/ABTableViewCell.m
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (c) 2008 Loren Brichter
//
//
// Permission is hereby granted, free of charge, to any person
// obtaining a copy of this software and associated documentation
// files (the "Software"), to deal in the Software without
Expand All @@ -8,10 +8,10 @@
// copies of the Software, and to permit persons to whom the
// Software is furnished to do so, subject to the following
// conditions:
//
//
// The above copyright notice and this permission notice shall be
// included in all copies or substantial portions of the Software.
//
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES
// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
Expand Down
14 changes: 7 additions & 7 deletions Classes/UI/ListeningViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ - (void) viewDidLoad {

NSLog(@"Setting up shout manager...");
shoutManager = [[ShoutManager alloc] init];

NSLog(@"Setting up shouts data source...");
[shoutManager setWho:@"listening"];
ListeningDataSource *shoutsDataSource = [ListeningDataSource initWithManager:shoutManager controller:self];

NSLog(@"Setting up list view...");
[tableView setDataSource:shoutsDataSource];
[tableView setDelegate:shoutsDataSource];
Expand All @@ -52,7 +52,7 @@ - (void) viewDidLoad {
- (void) viewWillAppear:(BOOL)animated {
NSLog(@"ListeningViewController viewWillAppear");
[super viewWillAppear:animated];

// Start data retrieval
NSLog(@"Starting shout retrieval...");
//[self refreshShoutList];
Expand All @@ -73,20 +73,20 @@ - (void) viewWillDisappear:(BOOL)animated {

- (void) dataLoaded:(NSArray *)shouts {
NSLog(@"ListeningViewController dataLoaded");

// Update tab bar item badge
NSUInteger shoutCount = 0;
if (shouts != nil) {
shoutCount = [shouts count];
}
NSString *shoutCountS = [NSString stringWithFormat:@"%u", shoutCount];
[[self tabBarItem] setBadgeValue:shoutCountS];

// Update list view table
[tableView setHidden:NO];
[tableView reloadData];
// [tableView performSelectorInBackground:@selector(reloadData) withObject:nil];

// Scroll to first shout
// Reconsidering this, given auto-reload
NSArray *visibleCells = [tableView visibleCells];
Expand All @@ -100,7 +100,7 @@ - (void) dataLoaded:(NSArray *)shouts {
[tableView scrollToRowAtIndexPath:indexPath atScrollPosition:UITableViewScrollPositionTop animated:NO];
[indexPath release];
}

// Let user know we're done reloading
[spinnerView stopAnimating];
if (isFirstLoad) {
Expand Down
10 changes: 5 additions & 5 deletions Classes/UI/NearbyViewController.m
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,11 @@ - (void) dealloc {

- (void) viewDidLoad {
[super viewDidLoad];

// Set up data source
shoutManager = [[ShoutManager alloc] init];
nearbyDataSource = [NearbyDataSource initWithManager:shoutManager controller:self];

// Set up map view
NSLog(@"Setting up map view...");
mapView = (RMMapView *)[self view];
Expand All @@ -47,7 +47,7 @@ - (void) viewDidLoad {
[mapContents setZoomBounds:0.5 maxZoom:125000];
[mapView setDelegate: self];
[self setView:mapView];

}

- (void) viewWillAppear:(BOOL)animated {
Expand All @@ -57,7 +57,7 @@ - (void) viewWillAppear:(BOOL)animated {
[LocationManager setDelegate:self];
NSLog(@" - NearbyViewController starting location updates...");
[LocationManager startUpdating];

// Start data retrieval
//NSLog(@"Starting shout retrieval...");
// [spinnerView startAnimating];
Expand Down Expand Up @@ -191,7 +191,7 @@ - (void) locationManager:(CLLocationManager *)manager didUpdateToLocation:(CLLoc
NSLog(@" - NearbyViewController updating with location: %@", newLocation);
CLLocationCoordinate2D coordinate = newLocation.coordinate;
[[mapView contents] setMapCenter:coordinate];

NSLog(@" - Starting shout retrieval...");
// Start data retrieval
[self refreshShoutList];
Expand Down
28 changes: 14 additions & 14 deletions Classes/UI/ShoutListCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -70,30 +70,30 @@ - (void)drawContentView:(CGRect)r {
//CFAbsoluteTime currentMethodStart = CFAbsoluteTimeGetCurrent();
NSArray *mySizes = [allSizes objectForKey:shoutId];
//NSLog(@" - mySizes: %@", mySizes);

CGContextRef context = UIGraphicsGetCurrentContext();
UIColor *backgroundColor = [UIColor whiteColor];
UIColor *textColor = [UIColor blackColor];
if(self.selected) {
backgroundColor = [UIColor clearColor];
textColor = [UIColor whiteColor];
}

// Fill cell with background color
[backgroundColor set];
CGContextFillRect(context, r);

// Draw user's icon
[[shout icon] drawAtPoint:CGPointMake(SHOUTCELL_MARGIN_HORIZONTAL, SHOUTCELL_MARGIN_VERTICAL)];

[textColor set];
//float messageWidth = [[mySizes objectAtIndex:0] floatValue];
float messageHeight = [[mySizes objectAtIndex:1] floatValue];
//NSLog(@" - messageWidth: %f", messageWidth);
//NSLog(@" - messageHeight: %f", messageHeight);
CGRect firstRect = CGRectMake(LABEL_ORIGIN_X, SHOUTCELL_MARGIN_VERTICAL, labelWidth, messageHeight);
CGSize firstSizeDrawn = [message drawInRect:firstRect withFont:messageFont lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentLeft];

//CGSize ageSize = [age sizeWithFont:ageFont constrainedToSize:maxTextSize lineBreakMode:UILineBreakModeWordWrap];
//float ageWidth = ageSize.width;
float ageWidth = [[mySizes objectAtIndex:2] floatValue];
Expand All @@ -109,7 +109,7 @@ - (void)drawContentView:(CGRect)r {
ageY = MAX(ageMinY, ageY);
//NSLog(@" - ageY: %f", ageY);
CGRect ageRect = CGRectMake(ageX, ageY, ageWidth, ageHeight);
//CGSize ageSizeDrawn =
//CGSize ageSizeDrawn =
[age drawInRect:ageRect withFont:ageFont lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentRight];
//NSLog(@" - ageSizeDrawn.width: %f", ageSizeDrawn.width);
//NSLog(@" - ageSizeDrawn.height: %f", ageSizeDrawn.height);
Expand Down Expand Up @@ -151,7 +151,7 @@ + (CGFloat) heightForShout:(Shout *)shout {
NSString *shoutId = [shout shouts_history_id];
NSString *message = [ShoutListCell messageForShout: shout];
NSString *age = [shout relativeShoutTime];

BOOL calculate = YES;
NSMutableArray *mySizes = [allSizes objectForKey:shoutId];
if (mySizes != nil) {
Expand All @@ -168,7 +168,7 @@ + (CGFloat) heightForShout:(Shout *)shout {
NSLog(@" - new : %@ %@", message, age);
}
}
if (calculate) {
if (calculate) {
//NSLog(@" - creating new mySizes");
mySizes = [[NSMutableArray alloc] initWithCapacity:5];
//NSLog(@" - mySizes: %@", mySizes);
Expand All @@ -182,33 +182,33 @@ + (CGFloat) heightForShout:(Shout *)shout {
[mySizes addObject:messageHeightNSN];
[messageWidthNSN release];
[messageHeightNSN release];

// Text height, plus vertical margins above and below
result = (SHOUTCELL_MARGIN_VERTICAL * 2) + messageSize.height;
//NSLog(@" - result: %f", result);

CGSize ageSize = [age sizeWithFont:ageFont constrainedToSize:maxTextSize lineBreakMode:UILineBreakModeWordWrap];
NSNumber *ageWidthNSN = [[NSNumber alloc] initWithFloat:ageSize.width];
NSNumber *ageHeightNSN = [[NSNumber alloc] initWithFloat:ageSize.height];
[mySizes addObject:ageWidthNSN];
[mySizes addObject:ageHeightNSN];
[ageWidthNSN release];
[ageHeightNSN release];

// Add this text's height plus a final bottom margin.
result += ageSize.height + SHOUTCELL_MARGIN_VERTICAL;
//NSLog(@" - result: %f", result);

result = MAX(result, CELL_HEIGHT_MIN); // at least one row
//NSLog(@" - result: %f", result);
NSNumber *cellHeightNSN = [[NSNumber alloc] initWithFloat:result];
[mySizes addObject:cellHeightNSN];
[cellHeightNSN release];

// For later comparison
[mySizes addObject:message];
[mySizes addObject:age];

//NSLog(@" - mySizes: %@", mySizes);
[allSizes setValue:mySizes forKey:shoutId];
[mySizes release];
Expand Down
Loading