Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #741 from aporat/compiler-warnings-fix

Compiler warnings fixes
  • Loading branch information...
commit cb100b8a2afc5767109e6b9477484a76a4675ae7 2 parents 8f27f02 + c421ddf
@diederich diederich authored
View
7 samples/TTCatalog/Classes/TableDragRefreshController.m
@@ -28,11 +28,8 @@ - (void) createModel {
[ds release];
}
-- (id<TTTableViewDelegate>) createDelegate {
-
- TTTableViewDragRefreshDelegate *delegate = [[TTTableViewDragRefreshDelegate alloc] initWithController:self];
-
- return [delegate autorelease];
+- (id<UITableViewDelegate>)createDelegate {
+ return [[[TTTableViewDragRefreshDelegate alloc] initWithController:self] autorelease];
}
@end
View
13 src/Three20Network/Sources/TTRequestLoader.m
@@ -35,6 +35,11 @@
#import "Three20Core/TTDebug.h"
#import "Three20Core/TTDebugFlags.h"
+@interface TTRequestLoader (Private)
+- (void)connection:(NSURLConnection*)connection didReceiveResponse:(NSHTTPURLResponse*)response ;
+- (void)connection:(NSURLConnection*)connection didReceiveData:(NSData*)data ;
+- (void)connectionDidFinishLoading:(NSURLConnection *)connection ;
+@end
static const NSInteger kLoadMaxRetries = 2;
@@ -100,13 +105,15 @@ - (void)deliverDataResponse:(NSURL*)URL {
// Strictly speaking, to be really conformant need to interpret %xx hex encoded entities.
// The [NSString dataUsingEncoding] doesn't do that correctly, but most documents don't use that.
// Skip for now.
- _responseData = [[[dataSplit objectAtIndex:1] dataUsingEncoding:NSASCIIStringEncoding] retain];
+ _responseData = [[NSMutableData dataWithData:[[dataSplit objectAtIndex:1] dataUsingEncoding:NSASCIIStringEncoding]] retain];
} else {
_responseData = [[NSData dataWithBase64EncodedString:[dataSplit objectAtIndex:1]] retain];
}
- [_queue performSelector:@selector(loader:didLoadResponse:data:) withObject:self
- withObject:_response withObject:_responseData];
+ [_queue performSelector:@selector(loader:didLoadResponse:data:)
+ withObject:self
+ withObject:_response
+ withObject:_responseData];
}
///////////////////////////////////////////////////////////////////////////////////////////////////
View
18 src/Three20UI/Sources/TTMessageController.m
@@ -423,7 +423,7 @@ - (BOOL)persistView:(NSMutableDictionary*)state {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)restoreView:(NSDictionary*)state {
- self.view;
+ [self view];
TT_RELEASE_SAFELY(_initialRecipients);
NSMutableArray* fields = [state objectForKey:@"fields"];
for (NSInteger i = 0; i < fields.count; ++i) {
@@ -540,7 +540,7 @@ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)butto
///////////////////////////////////////////////////////////////////////////////////////////////////
- (NSString*)subject {
- self.view;
+ [self view];
for (int i = 0; i < _fields.count; ++i) {
id field = [_fields objectAtIndex:i];
if ([field isKindOfClass:[TTMessageSubjectField class]]) {
@@ -554,7 +554,7 @@ - (NSString*)subject {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)setSubject:(NSString*)subject {
- self.view;
+ [self view];
for (int i = 0; i < _fields.count; ++i) {
id field = [_fields objectAtIndex:i];
if ([field isKindOfClass:[TTMessageSubjectField class]]) {
@@ -574,7 +574,7 @@ - (NSString*)body {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)setBody:(NSString*)body {
- self.view;
+ [self view];
_textEditor.text = body;
}
@@ -610,7 +610,7 @@ - (void)setFields:(NSArray*)fields {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)addRecipient:(id)recipient forFieldAtIndex:(NSUInteger)fieldIndex {
- self.view;
+ [self view];
TTPickerTextField* textField = [_fieldViews objectAtIndex:fieldIndex];
if ([textField isKindOfClass:[TTPickerTextField class]]) {
NSString* label = [_dataSource tableView:textField.tableView labelForObject:recipient];
@@ -623,7 +623,7 @@ - (void)addRecipient:(id)recipient forFieldAtIndex:(NSUInteger)fieldIndex {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (NSString*)textForFieldAtIndex:(NSUInteger)fieldIndex {
- self.view;
+ [self view];
NSString* text = nil;
if (fieldIndex == _fieldViews.count) {
@@ -643,7 +643,7 @@ - (NSString*)textForFieldAtIndex:(NSUInteger)fieldIndex {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)setText:(NSString*)text forFieldAtIndex:(NSUInteger)fieldIndex {
- self.view;
+ [self view];
if (fieldIndex == _fieldViews.count) {
_textEditor.text = text;
@@ -658,7 +658,7 @@ - (void)setText:(NSString*)text forFieldAtIndex:(NSUInteger)fieldIndex {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (BOOL)fieldHasValueAtIndex:(NSUInteger)fieldIndex {
- self.view;
+ [self view];
if (fieldIndex == _fieldViews.count) {
return _textEditor.text.length > 0;
@@ -682,7 +682,7 @@ - (BOOL)fieldHasValueAtIndex:(NSUInteger)fieldIndex {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (UIView*)viewForFieldAtIndex:(NSUInteger)fieldIndex {
- self.view;
+ [self view];
if (fieldIndex == _fieldViews.count) {
return _textEditor;
View
6 src/Three20UI/Sources/TTModelViewController.m
@@ -377,7 +377,7 @@ - (void)invalidateModel {
[_model.delegates removeObject:self];
TT_RELEASE_SAFELY(_model);
if (wasModelCreated) {
- self.model;
+ [self model];
}
}
@@ -480,9 +480,9 @@ - (void)updateView {
_flags.isUpdatingView = YES;
// Ensure the model is created
- self.model;
+ [self model];
// Ensure the view is created
- self.view;
+ [self view];
[self updateViewStates];
View
2  src/Three20UI/Sources/TTNavigator.m
@@ -139,7 +139,7 @@ - (void)presentDependantController: (UIViewController*)controller
- (void)didRestoreController:(UIViewController*)controller {
if ([controller isKindOfClass:[TTModelViewController class]]) {
TTModelViewController* modelViewController = (TTModelViewController*)controller;
- modelViewController.model;
+ [modelViewController model];
}
}
View
3  src/Three20UI/Sources/TTPhotoViewController.m
@@ -379,7 +379,8 @@ - (void)showThumbnails {
// The photo source has a URL mapping in TTURLMap, so we use that to show the thumbs
NSDictionary* query = [NSDictionary dictionaryWithObject:self forKey:@"delegate"];
TTBaseNavigator* navigator = [TTBaseNavigator navigatorForView:self.view];
- _thumbsController = [[navigator viewControllerForURL:URL query:query] retain];
+ _thumbsController = (TTThumbsViewController*)[[navigator viewControllerForURL:URL
+ query:query] retain];
[navigator.URLMap setObject:_thumbsController forURL:URL];
} else {
View
4 src/Three20UI/Sources/TTPostController.m
@@ -478,7 +478,7 @@ - (void)alertView:(UIAlertView *)alertView clickedButtonAtIndex:(NSInteger)butto
///////////////////////////////////////////////////////////////////////////////////////////////////
- (UITextView*)textView {
- self.view;
+ [self view];
return _textView;
}
@@ -486,7 +486,7 @@ - (UITextView*)textView {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (UINavigationBar*)navigatorBar {
if (!_navigationBar) {
- self.view;
+ [self view];
}
return _navigationBar;
}
View
2  src/Three20UI/Sources/TTScrollView.m
@@ -85,7 +85,7 @@ - (id)initWithFrame:(CGRect)frame {
_scrollEnabled = YES;
_zoomEnabled = YES;
_rotateEnabled = YES;
- _orientation = UIDeviceOrientationPortrait;
+ _orientation = UIInterfaceOrientationPortrait;
_decelerationRate = 0.9; // Inertia, how faster slow the residual movement.
_maximumZoomScale = 4.0; // Maximum zoom scale default value.
_centerPageAnimationDuration = TT_TRANSITION_DURATION;
View
2  src/Three20UI/Sources/TTSearchTextField.m
@@ -419,7 +419,7 @@ - (void)search {
///////////////////////////////////////////////////////////////////////////////////////////////////
- (void)showSearchResults:(BOOL)show {
if (show && _dataSource) {
- self.tableView;
+ [self tableView];
if (!_shadowView) {
_shadowView = [[TTView alloc] init];
View
6 src/Three20UICommon/Sources/TTGlobalUICommon.m
@@ -113,7 +113,7 @@ BOOL TTIsPad() {
///////////////////////////////////////////////////////////////////////////////////////////////////
UIDeviceOrientation TTDeviceOrientation() {
- UIDeviceOrientation orient = [UIApplication sharedApplication].statusBarOrientation;
+ UIDeviceOrientation orient = [[UIDevice currentDevice] orientation];
if (UIDeviceOrientationUnknown == orient) {
return UIDeviceOrientationPortrait;
@@ -159,7 +159,7 @@ BOOL TTDeviceOrientationIsLandscape() {
sysctlbyname("hw.machine", machine, &size, NULL, 0);
NSString *platform = [NSString stringWithCString:machine encoding:NSASCIIStringEncoding];
free(machine);
-
+
if ([platform isEqualToString:@"iPhone1,1"]) return @"iPhone 1G";
if ([platform isEqualToString:@"iPhone1,2"]) return @"iPhone 3G";
if ([platform isEqualToString:@"iPhone2,1"]) return @"iPhone 3GS";
@@ -174,7 +174,7 @@ BOOL TTDeviceOrientationIsLandscape() {
if ([platform isEqualToString:@"iPad2,2"]) return @"iPad 2 (GSM)";
if ([platform isEqualToString:@"iPad2,3"]) return @"iPad 2 (CDMA)";
if ([platform isEqualToString:@"i386"]) return @"Simulator";
-
+
return platform;
}
View
6 src/Three20UINavigator/Sources/TTBaseNavigator.m
@@ -678,7 +678,7 @@ - (UIViewController*)viewControllerForURL:(NSString*)URL query:(NSDictionary*)qu
///////////////////////////////////////////////////////////////////////////////////////////////////
- (UIViewController*)viewControllerForURL: (NSString*)URL
query: (NSDictionary*)query
- pattern: (TTURLNavigatorPattern**)pattern {
+ pattern: (TTURLPattern**)pattern {
NSRange fragmentRange = [URL rangeOfString:@"#" options:NSBackwardsSearch];
if (fragmentRange.location != NSNotFound) {
NSString* baseURL = [URL substringToIndex:fragmentRange.location];
@@ -693,7 +693,7 @@ - (UIViewController*)viewControllerForURL: (NSString*)URL
}
} else {
- id object = [_URLMap objectForURL:baseURL query:nil pattern:pattern];
+ id object = [_URLMap objectForURL:baseURL query:nil pattern:(TTURLNavigatorPattern**)pattern];
if (object) {
id result = [_URLMap dispatchURL:URL toTarget:object query:query];
if ([result isKindOfClass:[UIViewController class]]) {
@@ -709,7 +709,7 @@ - (UIViewController*)viewControllerForURL: (NSString*)URL
}
}
- id object = [_URLMap objectForURL:URL query:query pattern:pattern];
+ id object = [_URLMap objectForURL:URL query:query pattern:(TTURLNavigatorPattern**)pattern];
if (object) {
UIViewController* controller = object;
controller.originalNavigatorURL = URL;
Please sign in to comment.
Something went wrong with that request. Please try again.