2011-01-25 54 views
0

我正在制作一个简单的数学应用程序,Xcode表示它的构建正确,但该应用程序无法在模拟器或我的设备上打开。这是一个基于winow的应用程序,但是我手动添加了一个UITabBarController数学应用程序崩溃

这是我AreaViewController.h说什么

#import <UIKit/UIKit.h> 


@interface AreaViewController : UIViewController { 
    <snipped ivars> 
} 

@property (retain, nonatomic) UITextField *add11; 
@property (retain, nonatomic) UITextField *add12; 
@property (retain, nonatomic) UITextField *add13; 
@property (retain, nonatomic) UITextField *add21; 
@property (retain, nonatomic) UITextField *add22; 
@property (retain, nonatomic) UITextField *add23; 
@property (retain, nonatomic) UITextField *add31; 
@property (retain, nonatomic) UITextField *add32; 
@property (retain, nonatomic) UITextField *add33; 
@property (retain, nonatomic) UILabel *add1Result; 
@property (retain, nonatomic) UILabel *add2Result; 
@property (retain, nonatomic) UILabel *add3Result; 

-(IBAction)calculate:(id)sender; 
-(IBAction)hideKeyboard:(id)sender; 

@end 

我AreaViewController.m

#import "AreaViewController.h" 


@implementation AreaViewController 

@synthesize add11, add12, add13; 
@synthesize add21, add22, add23; 
@synthesize add31, add32, add33; 
@synthesize add1Result, add2Result, add3Result; 

-(IBAction)calculate:(id)sender { 
float floatAdd1Result=[add11.text floatValue]+[add12.text floatValue]+[add13.text floatValue]; 
float floatAdd2Result=[add21.text floatValue]+[add22.text floatValue]+[add23.text floatValue]; 
float floatAdd3Result=[add31.text floatValue]+[add32.text floatValue]+[add33.text floatValue]; 

add1Result.text=[NSString stringWithFormat:@"%1.2f",floatAdd1Result]; 
add2Result.text=[NSString stringWithFormat:@"%1.2f",floatAdd2Result]; 
add3Result.text=[NSString stringWithFormat:@"%1.2f",floatAdd3Result]; 
} 

-(IBAction)hideKeyboard:(id)sender { 
[add11 resignFirstResponder]; 
[add12 resignFirstResponder]; 
[add13 resignFirstResponder]; 
[add21 resignFirstResponder]; 
[add22 resignFirstResponder]; 
[add23 resignFirstResponder]; 
[add31 resignFirstResponder]; 
[add32 resignFirstResponder]; 
[add33 resignFirstResponder]; 
}  

- (void)dealloc { 
[add11 release]; 
[add12 release]; 
[add13 release]; 
[add21 release]; 
[add22 release]; 
[add23 release]; 
[add31 release]; 
[add32 release]; 
[add33 release]; 
[add1Result release]; 
[add2Result release]; 
[add2Result release]; 
[super dealloc]; 
} 


@end 

我的控制台说:

[Session started at 2011-01-24 18:33:13 -0600.] 

WARNING: Falling back to active SDK directory at: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk 

<snip> 
This GDB was configured as "--host=i386-apple-darwin --target=arm-apple-darwin".tty /dev/ttys004 
Loading program into debugger… 
Program loaded. 
target remote-mobile /tmp/.XcodeGDBRemote-3466-67 
Switching to remote-macosx protocol 
mem 0x1000 0x3fffffff cache 
mem 0x40000000 0xffffffff none 
mem 0x00000000 0x0fff none 
run 
Running… 
[Switching to thread 11523] 
[Switching to thread 11523] 
sharedlibrary apply-load-rules all 
continue 
warning: UUID mismatch detected with the loaded library - on disk is: 
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/Frameworks/Foundation.framework/Foundation 
<snip> 
warning: UUID mismatch detected with the loaded library - on disk is: 
/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/PrivateFrameworks/MBX2D.framework/MBX2D 
Ignoring packet error, continuing... 
gdb stack trace around reply contains invalid hex digit: 
0 gdb-arm-apple-darwin    0x0018dc33 remote_backtrace_self + 54� 
1 gdb-arm-apple-darwin    0x0019081d fromhex + 65� 
<snip> 
43 gdb-arm-apple-darwin    0x00085592 catch_errors + 78� 
44 gdb-arm-apple-darwin    0x0008646b gdb_main + 63� 
45 gdb-arm-apple-darwin    0x00001f06 main + 52� 
46 gdb-arm-apple-darwin    0x00001e95 start + 53� 
recent remote packet log at point of error: 
Sent: [1295915610.545:96] m3757d780,40 
Recvd: [1295915610.548:96] 1800000074f9710fa01a33b5bb04c4aeabd6be7d220000803000000000000000000000000c3197080807000000e06c080000000064eaa708c8120000cc688b08 
Sent: [1295915610.548:96] m3757d7c0,40 
Recvd: [1295915610.551:96] 

warning: Unable to read symbols from [memory object "/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/PrivateFrameworks/MBX2D.framework/MBX2D" at 0x3076a000]: File format not recognized. 
warning: Could not read dyld entry: /Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS4.0.sdk/System/Library/PrivateFrameworks/MBX2D.framework/MBX2D from inferior memory at 0x3076a000 with slide 0x0 and length 4294967295. 

The Debugger has exited due to signal 15 (SIGTERM).The Debugger has exited due to signal 15 (SIGTERM). 

[Session started at 2011-01-24 18:36:46 -0600.] 
Terminating in response to SpringBoard's termination. 

编辑戴维DELO ng:

我尽可能地减少了代码。我删除了实例变量声明,并且留下了@property声明,折叠了@synthesize行,简化了代码,剥离了死亡方法,剪掉了长时间重复的东西等。我还删除了代码下载链接,因为它只链接到压缩的副本.xcodeproj文件(但没有源文件)。

+1

@user运行588343 StackOverflow不是一个地方,你可以转储一堆代码,并要求我们为你解决它。您需要向我们展示您试图将其缩小到特定的方法并向我们展示您对解决问题的效果所做的工作。 – 2011-01-25 01:14:16

回答

0

事实上,你在动态加载器中死去似乎意味着你的二进制文件没有正确构建。当我开始发生奇怪的错误时,我发现最好清理整个项目并重新构建一切。要清理,只需转到Build菜单并选择“清理所有目标”。一旦完成,请尝试再次建立并运行。

+0

不好意思倾销所有的代码。我有点新开发。好的,我尝试清理整个项目,并在模拟器中重新构建它,但它仍然存在相同的问题。我试图从头开始重新编写代码,但仍然没有任何结果。我想知道你是否有机会看看我的源文件。有什么可以尝试去做到的吗?上面是我的源文件的链接。任何帮助,将不胜感激!!!我正在尝试为应用商店制作我的第一个应用。提前致谢! – Azhar85 2011-01-25 02:06:18

+0

@ user588343您最初发布的链接仅适用于xcodeproj文件,该文件只包含项目中文件的列表。它实际上并不包含源代码。 – 2011-01-25 04:23:10

+0

我应该发布什么内容?整个应用程序文件夹?这是没有问题的,如果这是你需要的 – Azhar85 2011-01-25 22:13:56

0

有时,这有助于我:

  1. 重新启动设备
  2. 重新启动的Xcode
  3. 干净所有的构建和干净的Xcode缓存
  4. 删除所有断点......我看到的Xcode变得疯狂,从项目中删除所有断点后再次正常。有时Xcode会丢失弹珠,你必须帮助它。
  5. 作为一个激进的措施右键单击xcodeproj文件,选择Show Package Contents并删除该包内除pbxproj文件外的所有内容。然后重新打开该项目。

做#5让你的项目的备份...以防万一之前。

编辑:

你可以有你的磁盘或Xcode的一个问题。使用磁盘实用程序并验证/修复磁盘上的权限,删除然后重新安装新版本的Xcode/SDk。看看是否有效。

0

尝试:

  1. 拔掉电话
  2. 从手机中删除应用程序(使用的牵着你的手指放在图标上,直到“X”的标准方法出现)
  3. 一旦删除,插头回到并重新打造
  4. 再次在设备上的应用程序崩溃,但大跌后这段时间,再次拔出并直接从手机