Permalink
Browse files

Resolved build warnings in Xcode 4

  • Loading branch information...
1 parent eab5558 commit 2952ecb1e6ec34eb32767beca42f36e816cc6443 Matthew Brewer committed Mar 16, 2011
@@ -878,7 +878,7 @@
);
PREBINDING = NO;
SDKROOT = iphoneos;
- VALID_ARCHS = "armv6 armv7";
+ VALID_ARCHS = "armv6 armv7 i386";
};
name = Debug;
};
@@ -898,7 +898,7 @@
);
PREBINDING = NO;
SDKROOT = iphoneos;
- VALID_ARCHS = "armv6 armv7";
+ VALID_ARCHS = "armv6 armv7 i386";
};
name = Release;
};
@@ -47,7 +47,7 @@ @implementation ABTableViewCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
- if(self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])
+ if((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]))
{
contentView = [[ABTableViewCellView alloc] initWithFrame:CGRectZero];
contentView.opaque = YES;
@@ -59,7 +59,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier
{
- if(self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier])
+ if((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]))
{
contentView = [[ABTableViewCellView alloc] initWithFrame:CGRectZero];
contentView.opaque = YES;
@@ -0,0 +1,29 @@
+//
+// TKAlertView.h
+// TapkuLibrary
+//
+// Created by Matthew Brewer on 3/8/11.
+// Copyright 2011 University of Tennessee: College of Business. All rights reserved.
+//
+
+#import <UIKit/UIKit.h>
+
+@class TKAlertView;
+typedef void (^TKAlertViewCompletionBlock)(TKAlertView* view);
+
+@interface TKAlertView : UIView {
+ CGRect messageRect;
+ NSString *text;
+ UIImage *image;
+
+ BOOL blocking;
+ TKAlertViewCompletionBlock completion;
+
+}
+
+@property (nonatomic, retain) NSString* text;
+@property (nonatomic, retain) UIImage* image;
+@property (nonatomic, getter=isBlocking) BOOL blocking;
+@property (nonatomic, copy) TKAlertViewCompletionBlock completion;
+
+@end
@@ -0,0 +1,87 @@
+//
+// TKAlertView.m
+// TapkuLibrary
+//
+// Created by Matthew Brewer on 3/8/11.
+// Copyright 2011 University of Tennessee: College of Business. All rights reserved.
+//
+
+#import "TKAlertView.h"
+#import "UIView+TKCategory.h"
+
+@implementation TKAlertView
+
+- (id)init {
+ return [self initWithFrame:CGRectMake(0, 0, 100, 100)];
+}
+
+- (id)initWithFrame:(CGRect)frame {
+ if ( (self = [super initWithFrame:frame]) ) {
+ messageRect = CGRectInset(self.bounds, 10, 10);
+ self.backgroundColor = [UIColor clearColor];
+ } return self;
+}
+
+- (void)adjust {
+
+ CGSize s = [text sizeWithFont:[UIFont boldSystemFontOfSize:14] constrainedToSize:CGSizeMake(160,200) lineBreakMode:UILineBreakModeWordWrap];
+
+ float imageAdjustment = 0;
+ if (image) {
+ imageAdjustment = 7+image.size.height;
+ }
+
+ self.bounds = CGRectMake(0, 0, s.width+40, s.height+15+15+imageAdjustment);
+
+ messageRect.size = s;
+ messageRect.size.height += 5;
+ messageRect.origin.x = 20;
+ messageRect.origin.y = 15+imageAdjustment;
+
+ [self setNeedsLayout];
+ [self setNeedsDisplay];
+
+}
+
+- (void)drawRect:(CGRect)rect{
+ [UIView drawRoundRectangleInRect:rect withRadius:10 color:[UIColor colorWithWhite:0 alpha:0.8]];
+ [[UIColor whiteColor] set];
+ [text drawInRect:messageRect withFont:[UIFont boldSystemFontOfSize:14] lineBreakMode:UILineBreakModeWordWrap alignment:UITextAlignmentCenter];
+
+ CGRect r = CGRectZero;
+ r.origin.y = 15;
+ r.origin.x = (rect.size.width-image.size.width)/2;
+ r.size = image.size;
+
+ [image drawInRect:r];
+}
+
+- (void)dealloc {
+ self.text = nil;
+ self.image = nil;
+ [super dealloc];
+}
+
+#pragma mark -
+#pragma mark Properties
+@synthesize text, image;
+@synthesize blocking, completion;
+
+- (void)setText:(NSString *)s {
+ if ( s != text ) {
+ [text release];
+ text = [s retain];
+ [self adjust];
+ }
+}
+
+- (void)setImage:(UIImage *)img {
+ if ( img != image ) {
+ [image release];
+ image = [img retain];
+ [self adjust];
+ }
+}
+
+
+@end
@@ -48,7 +48,7 @@ @implementation TKCalendarDayEventView
// The designated initializer. Override to perform setup that is required before the view is loaded.
// Only when xibless (interface buildder)
- (id)initWithFrame:(CGRect)frame {
- if (self = [super initWithFrame:frame]) {
+ if ((self = [super initWithFrame:frame])) {
// Custom initialization
[self setupCustomInitialisation];
}
@@ -58,7 +58,7 @@ - (id)initWithFrame:(CGRect)frame {
// The designated initializer. Override to perform setup that is required before the view is loaded.
// Only when using xib (interface buildder)
- (id)initWithCoder:(NSCoder *)decoder {
- if (self = [super initWithCoder:decoder]) {
+ if ((self = [super initWithCoder:decoder])) {
// Custom initialization
[self setupCustomInitialisation];
}
@@ -76,7 +76,7 @@ @implementation TKCalendarDayTimelineView
// The designated initializer. Override to perform setup that is required before the view is loaded.
// Only when xibless (interface buildder)
- (id)initWithFrame:(CGRect)frame {
- if (self = [super initWithFrame:frame]) {
+ if ((self = [super initWithFrame:frame])) {
// Custom initialization
[self setupCustomInitialisation];
}
@@ -86,7 +86,7 @@ - (id)initWithFrame:(CGRect)frame {
// The designated initializer. Override to perform setup that is required before the view is loaded.
// Only when using xib (interface buildder)
- (id)initWithCoder:(NSCoder *)decoder {
- if (self = [super initWithCoder:decoder]) {
+ if ((self = [super initWithCoder:decoder])) {
// Custom initialization
[self setupCustomInitialisation];
}
@@ -451,7 +451,7 @@ @implementation TKTimelineView
// The designated initializer. Override to perform setup that is required before the view is loaded.
// Only when xibless (interface buildder)
- (id)initWithFrame:(CGRect)frame {
- if (self = [super initWithFrame:frame]) {
+ if ((self = [super initWithFrame:frame])) {
// Custom initialization
[self setupCustomInitialisation];
}
@@ -461,7 +461,7 @@ - (id)initWithFrame:(CGRect)frame {
// The designated initializer. Override to perform setup that is required before the view is loaded.
// Only when using xib (interface buildder)
- (id)initWithCoder:(NSCoder *)decoder {
- if (self = [super initWithCoder:decoder]) {
+ if ((self = [super initWithCoder:decoder])) {
// Custom initialization
[self setupCustomInitialisation];
}
@@ -41,7 +41,7 @@ @implementation TKCoverflowCoverView
- (id) initWithFrame:(CGRect)frame {
- if (self = [super initWithFrame:frame]) {
+ if ((self = [super initWithFrame:frame])) {
self.opaque = NO;
self.backgroundColor = [UIColor clearColor];
self.layer.anchorPoint = CGPointMake(0.5, 0.5);
@@ -50,7 +50,7 @@ @implementation TKEmptyView
- (id) initWithFrame:(CGRect)frame mask:(UIImage*)image title:(NSString*)titleString subtitle:(NSString*)subtitleString{
- if(self = [super initWithFrame:frame]){
+ if((self = [super initWithFrame:frame])){
self.backgroundColor = [UIColor whiteColor];
@@ -37,7 +37,7 @@ @implementation TKLabelCell
@synthesize label;
- (id) initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier {
- if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
+ if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) {
// Initialization code
label = [[UILabel alloc] initWithFrame:CGRectZero];
label.textAlignment = UITextAlignmentRight;
@@ -38,7 +38,7 @@ @implementation TKLabelFieldCell
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
- if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]) {
+ if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier])) {
// Initialization code
field = [[UILabel alloc] initWithFrame:CGRectZero];
[self addSubview:field];
@@ -36,7 +36,7 @@ @implementation TKLabelSwitchCell
@synthesize switcher;
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
- if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]) {
+ if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier])) {
// Initialization code
switcher = [[UISwitch alloc] initWithFrame:CGRectZero];
[self addSubview:switcher];
@@ -38,7 +38,7 @@ @implementation TKLabelTextFieldCell
- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
- if (self = [super initWithStyle:style reuseIdentifier:reuseIdentifier]) {
+ if ((self = [super initWithStyle:style reuseIdentifier:reuseIdentifier])) {
// Initialization code
field = [[UITextField alloc] initWithFrame:CGRectZero];
field.autocorrectionType = UITextAutocorrectionTypeYes;
@@ -54,7 +54,7 @@ - (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reus
}
- (id)initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
- if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]) {
+ if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier])) {
// Initialization code
field = [[UITextField alloc] initWithFrame:CGRectZero];
field.autocorrectionType = UITextAutocorrectionTypeYes;
@@ -37,7 +37,7 @@ @implementation TKLabelTextViewCell
@synthesize textView;
- (id) initWithFrame:(CGRect)frame reuseIdentifier:(NSString *)reuseIdentifier {
- if (self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier]) {
+ if ((self = [super initWithStyle:UITableViewCellStyleDefault reuseIdentifier:reuseIdentifier])) {
// Initialization code
textView = [[UITextView alloc] initWithFrame:CGRectZero];
@@ -45,7 +45,7 @@ @implementation TKLoadingView
@synthesize radius;
- (id) initWithTitle:(NSString*)ttl message:(NSString*)msg{
- if(self = [super initWithFrame:CGRectMake(0, 0, 280, 200)]){
+ if((self = [super initWithFrame:CGRectMake(0, 0, 280, 200)])){
_title = [ttl copy];
_message = [msg copy];
@@ -155,8 +155,8 @@ - (void) stopAnimating{
}
-- (CGSize) calculateHeightOfTextFromWidth:(NSString*)text font: (UIFont*)withFont width:(float)width linebreak:(UILineBreakMode)lineBreakMode{
- return [text sizeWithFont:withFont
+- (CGSize) calculateHeightOfTextFromWidth:(NSString*)str font: (UIFont*)withFont width:(float)width linebreak:(UILineBreakMode)lineBreakMode{
+ return [str sizeWithFont:withFont
constrainedToSize:CGSizeMake(width, FLT_MAX)
lineBreakMode:lineBreakMode];
}

0 comments on commit 2952ecb

Please sign in to comment.