2011-01-25 318 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. 再次在設備上的應用程序崩潰,但大跌後這段時間,再次拔出並直接從手機