Go Back   MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 27, 2010, 08:49 AM   #1
mikezang
macrumors 6502a
 
Join Date: May 2010
Location: Tokyo, Japan
What can I do for a Build Failed?

I made a simple app as below, when I compiled it, I got a "Build Failed" error, I don"t why, pls help me.
Code:
//  PersistenceViewController.h
#import <UIKit/UIKit.h>
#define kFilename	@"trade.plist"
@interface PersistenceViewController : UIViewController {
	UITextField *startDate;
	UITextField *endDate;
	UITextField *tradeType;
	UITextField *account;
	UITextField *code;
	UITextField *amount;
	UITextField *startPrice;
	UITextField *endPrice;
	UITextField *value;
	UITextField *profitLoss;
	UITextField *profitLossRate;
	UITextField *fee;
	UITextField *tax;
	UITextField *interest;
}
@property (nonatomic, retain) IBOutlet UITextField *startDate;
@property (nonatomic, retain) IBOutlet UITextField *endDate;
@property (nonatomic, retain) IBOutlet UITextField *tradeType;
@property (nonatomic, retain) IBOutlet UITextField *account;
@property (nonatomic, retain) IBOutlet UITextField *code;
@property (nonatomic, retain) IBOutlet UITextField *amount;
@property (nonatomic, retain) IBOutlet UITextField *startPrice;
@property (nonatomic, retain) IBOutlet UITextField *endPrice;
@property (nonatomic, retain) IBOutlet UITextField *value;
@property (nonatomic, retain) IBOutlet UITextField *profitLoss;
@property (nonatomic, retain) IBOutlet UITextField *profitLossRate;
@property (nonatomic, retain) IBOutlet UITextField *fee;
@property (nonatomic, retain) IBOutlet UITextField *tax;
@property (nonatomic, retain) IBOutlet UITextField *interest;
-(NSString *) dataFilePath;
-(void) applicationWillTerminate:(NSNotification *)notification;
@end
Code:
//  PersistenceViewController.m
#import "PersistenceViewController.h"
@implementation PersistenceViewController
@synthesize startDate;
@synthesize endDate;
@synthesize tradeType;
@synthesize account;
@synthesize code;
@synthesize amount;
@synthesize startPrice;
@synthesize endPrice;
@synthesize value;
@synthesize profitLoss;
@synthesize profitLossRate;
@synthesize fee;
@synthesize tax;
@synthesize interest;
-(NSString *) dataFilePath {
	NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
	NSString *documentsDirectory = [paths objectAtIndex:0];
	return [documentsDirectory stringByAppendingPathComponent:kFilename];
}
-(void) applicationWillTerminate:(NSNotification *)notification {
	NSMutableArray *array = [[NSMutableArray alloc] init];
	[array addObject:startDate.text];
	[array addObject:endDate.text];
	[array addObject:tradeType.text];
	[array addObject:account.text];
	[array addObject:code.text];
	[array addObject:amount.text];
	[array addObject:startPrice.text];
	[array addObject:endPrice.text];
	[array addObject:value.text];
	[array addObject:profitLoss.text];
	[array addObject:profitLossRate.text];
	[array addObject:fee.text];
	[array addObject:tax.text];
	[array addObject:interest.text];
	[array writeToFile:[self dataFilePath] atomically:YES];
	[array release];
}
- (void)viewDidLoad {
	NSString *filePath = [self dataFilePath];
	
if ([[NSFileManager defaultManager] fileExistsAtPath:filePath]) {
		NSArray *array = [[NSArray alloc] initWithContentsOfFile:filePath];
		startDate.text = [array objectAtIndex:0];
		endDate.text = [array objectAtIndex:1];
		tradeType.text = [array objectAtIndex:2];
		account.text = [array objectAtIndex:3];
		code.text = [array objectAtIndex:4];
		amount.text = [array objectAtIndex:5];
		startPrice.text = [array objectAtIndex:6];
		endPrice.text = [array objectAtIndex:7];
		value.text = [array objectAtIndex:8];
		profitLoss.text = [array objectAtIndex:9];
		profitLossRate.text = [array objectAtIndex:10];
		fee.text = [array objectAtIndex:11];
		tax.text = [array objectAtIndex:12];
		interest.text = [array objectAtIndex:12];
		[array release];
	}
	UIApplication *app = [UIApplication sharedApplication];
	[[NSNotificationCenter defaultCenter] addObserver:self selector:@selector(applicationWillTerminate:) name:UIApplicationWillTerminateNotification object:app];
	[super viewDidLoad];
}
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation {
    return YES;
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
}
- (void)viewDidUnload {
	self.startDate = nil;
	self.endDate = nil;
	self.account = nil;
	self.code = nil;
	self.amount = nil;
	self.startPrice = nil;
	self.endPrice = nil;
	self.value = nil;
	self.profitLoss = nil;
	self.profitLossRate = nil;
	self.fee = nil;
	self.tax = nil;
	self.interest = nil;
	[super viewDidUnload];
}
- (void)dealloc {
	[startDate release]; 
	[endDate release];
	[account release];
	[code release];
	[amount release];
	[startPrice release];
	[endPrice release];
	[value release];
	[profitLoss release];
	[profitLossRate release];
	[fee release];
	[tax release];
	[interest release];
    [super dealloc];
}
@end
Code:
ProcessPCH /var/folders/+D/+DggSL7nF8OME3lFbWxEDk+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/Persistence_Prefix-edniqrejmxqmlcfvjocrpdtfmsme/Persistence_Prefix.pch.gch Persistence_Prefix.pch normal i386 objective-c com.apple.compilers.gcc.4_2
cd /Users/mikezang/iPad/MyApp/Persistence
setenv LANG en_US.US-ASCII
setenv PATH "/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin"
/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 -x objective-c-header -arch i386 -fmessage-length=0 -pipe -std=c99 -Wno-trigraphs -fpascal-strings -fasm-blocks -O0 -Wreturn-type -Wunused-variable -D__IPHONE_OS_VERSION_MIN_REQUIRED=30200 -isysroot /Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator3.2.sdk -fvisibility=hidden -mmacosx-version-min=10.5 -gdwarf-2 -fobjc-abi-version=2 -fobjc-legacy-dispatch -iquote /Users/mikezang/iPad/MyApp/Persistence/build/Persistence.build/Debug-iphonesimulator/Persistence.build/Persistence-generated-files.hmap -I/Users/mikezang/iPad/MyApp/Persistence/build/Persistence.build/Debug-iphonesimulator/Persistence.build/Persistence-own-target-headers.hmap -I/Users/mikezang/iPad/MyApp/Persistence/build/Persistence.build/Debug-iphonesimulator/Persistence.build/Persistence-all-target-headers.hmap -iquote /Users/mikezang/iPad/MyApp/Persistence/build/Persistence.build/Debug-iphonesimulator/Persistence.build/Persistence-project-headers.hmap -F/Users/mikezang/iPad/MyApp/Persistence/build/Debug-iphonesimulator -I/Users/mikezang/iPad/MyApp/Persistence/build/Debug-iphonesimulator/include -I/Users/mikezang/iPad/MyApp/Persistence/build/Persistence.build/Debug-iphonesimulator/Persistence.build/DerivedSources/i386 -I/Users/mikezang/iPad/MyApp/Persistence/build/Persistence.build/Debug-iphonesimulator/Persistence.build/DerivedSources ? filePath -c /Users/mikezang/iPad/MyApp/Persistence/Persistence_Prefix.pch -o /var/folders/+D/+DggSL7nF8OME3lFbWxEDk+++TI/-Caches-/com.apple.Xcode.501/SharedPrecompiledHeaders/Persistence_Prefix-edniqrejmxqmlcfvjocrpdtfmsme/Persistence_Prefix.pch.gch

i686-apple-darwin10-gcc-4.2.1: ?: No such file or directory
i686-apple-darwin10-gcc-4.2.1: filePath: No such file or directory
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
__________________
iPad Mini 32GB, iPhone 4S 16GB, iPad1 32GB, Mac mini 2.53GHz 4GB 320GB, ThinkPad T60
MyApp: Market Event v1.9.2
mikezang is offline   0 Reply With Quote
Old Jul 27, 2010, 06:33 PM   #2
kainjow
Moderator emeritus
 
kainjow's Avatar
 
Join Date: Jun 2000
In the menu bar, go to Build > Build Results and post back what you see (screenshot and/or full text).
kainjow is offline   0 Reply With Quote
Old Jul 27, 2010, 07:15 PM   #3
PhoneyDeveloper
macrumors 68030
 
PhoneyDeveloper's Avatar
 
Join Date: Sep 2008
This line in the build transcript is causing the problem

Quote:
-I/Users/mikezang/iPad/MyApp/Persistence/build/Persistence.build/Debug-iphonesimulator/Persistence.build/DerivedSources ? filePath
Derived sources are things like lex/yacc where a file is generated by a tool as part of the build and then compiled by the C-language compiler. I don't understand how the "? filePath" has gotten into this -I line.

I would look at that path and see if there's a file or folder there. I'd probably delete the build folder and try again. Are there any Derived sources in this project, like lex/yacc or anything else besides .m, .h?

One other thing, it might be possible to end up with something like this if you've pasted something by mistake into a framework search path or one of the other project settings. I would look over the target settings to see if anything looks wrong.

While a -I like that seems like a bug of course it isn't a common bug. At the least if Xcode thinks there is something named "? filePath" it ought to quote it.
PhoneyDeveloper is offline   0 Reply With Quote
Old Jul 28, 2010, 05:46 AM   #4
mikezang
Thread Starter
macrumors 6502a
 
Join Date: May 2010
Location: Tokyo, Japan
Well, you can check my build result and I also upload my project, I hope I can get right result.
Attached Thumbnails
Click image for larger version

Name:	SnapShot 2010-07-28 at 19.42.14.jpg
Views:	32
Size:	277.6 KB
ID:	241830  
Attached Files
File Type: zip Archive.zip (21.6 KB, 18 views)
__________________
iPad Mini 32GB, iPhone 4S 16GB, iPad1 32GB, Mac mini 2.53GHz 4GB 320GB, ThinkPad T60
MyApp: Market Event v1.9.2
mikezang is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > iPhone/iPad Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Seasonpass : Process failed with reason: Filesystem patches failed! ... Had to use iR adammusic Apple TV and Home Theater 10 Jul 23, 2014 12:06 PM
getting "build failed" jkcerda iPhone/iPad Programming 10 Mar 17, 2014 05:34 PM
Partition failed Bowers iMac 0 Oct 11, 2013 08:16 PM
HD or partition failed? Random14 iMac 2 Oct 22, 2012 09:23 AM
HELP! Installation Failed! icomputered OS X 10.8 Mountain Lion 3 Jul 25, 2012 06:23 PM

Forum Jump

All times are GMT -5. The time now is 07:58 AM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC