App stürzt sofort ab.

Diese Seite verwendet Cookies. Durch die Nutzung unserer Seite erklären Sie sich damit einverstanden, dass wir Cookies setzen. Weitere Informationen

  • App stürzt sofort ab.

    Hallo zusammen,
    nachdem ich endlich meine erste App , zur Berechnung von Ranglistenpunkten, programmiert habe und auch auf ein iPhone über Cydia installiert habe, stehe ich jetzt als Anfänger gerade vor einem Problem , dass
    ich die App im Simulator super bedienen kann, aber wenn ich sie auf dem iPhone öffne sehe ich zwar das Ladebild aber dann stürzt die App sofort ab.Wo könnte den das Problem liegen?
    Hier mal der Code:
    main.m

    Quellcode

    1. #import <UIKit/UIKit.h>
    2. #import "AppDelegate.h"
    3. int main(int argc, char *argv[])
    4. {
    5. @autoreleasepool {
    6. return UIApplicationMain(argc, argv, nil, NSStringFromClass([AppDelegate class]));
    7. }
    8. }
    Alles anzeigen

    AppDelegate.h

    Quellcode

    1. #import <UIKit/UIKit.h>
    2. @class ViewController;
    3. @interface AppDelegate : UIResponder <UIApplicationDelegate>
    4. @property (strong, nonatomic) UIWindow *window;
    5. @property (strong, nonatomic) ViewController *viewController;
    6. @end
    Alles anzeigen


    AppDelegate.m

    Quellcode

    1. #import "AppDelegate.h"
    2. #import "ViewController.h"
    3. @implementation AppDelegate
    4. @synthesize window = _window;
    5. @synthesize viewController = _viewController;
    6. - (void)dealloc
    7. {
    8. [_window release];
    9. [_viewController release];
    10. [super dealloc];
    11. }
    12. - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
    13. {
    14. self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
    15. // Override point for customization after application launch.
    16. self.viewController = [[[ViewController alloc] initWithNibName:@"ViewController" bundle:nil] autorelease];
    17. self.window.rootViewController = self.viewController;
    18. [self.window makeKeyAndVisible];
    19. return YES;
    20. }
    21. - (void)applicationWillResignActive:(UIApplication *)application
    22. {
    23. /*
    24. Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state.
    25. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game.
    26. */
    27. }
    28. - (void)applicationDidEnterBackground:(UIApplication *)application
    29. {
    30. /*
    31. Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later.
    32. If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits.
    33. */
    34. }
    35. - (void)applicationWillEnterForeground:(UIApplication *)application
    36. {
    37. /*
    38. Called as part of the transition from the background to the inactive state; here you can undo many of the changes made on entering the background.
    39. */
    40. }
    41. - (void)applicationDidBecomeActive:(UIApplication *)application
    42. {
    43. /*
    44. Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    45. */
    46. }
    47. - (void)applicationWillTerminate:(UIApplication *)application
    48. {
    49. /*
    50. Called when the application is about to terminate.
    51. Save data if appropriate.
    52. See also applicationDidEnterBackground:.
    53. */
    54. }
    55. @end
    Alles anzeigen


    ViewController.h

    Quellcode

    1. #import <UIKit/UIKit.h>
    2. @interface ViewController : UIViewController
    3. @property (retain, nonatomic) IBOutlet UITextField *outAnzahl;
    4. @property (retain, nonatomic) IBOutlet UITextField *outPlatz;
    5. @property (retain, nonatomic) IBOutlet UITextField *outFaktor;
    6. @property (retain, nonatomic) IBOutlet UILabel *outErgebnis;
    7. - (IBAction)textFieldDoneEditing:(id)sender;
    8. - (IBAction)klick:(id)sender;
    9. @end
    Alles anzeigen


    ViewController.m

    Quellcode

    1. #import "ViewController.h"
    2. @implementation ViewController
    3. @synthesize outAnzahl;
    4. @synthesize outPlatz;
    5. @synthesize outFaktor;
    6. @synthesize outErgebnis;
    7. - (void)didReceiveMemoryWarning
    8. {
    9. [super didReceiveMemoryWarning];
    10. // Release any cached data, images, etc that aren't in use.
    11. }
    12. #pragma mark - View lifecycle
    13. - (void)viewDidLoad
    14. {
    15. [super viewDidLoad];
    16. // Do any additional setup after loading the view, typically from a nib.
    17. }
    18. - (void)viewDidUnload
    19. {
    20. [self setOutAnzahl:nil];
    21. [self setOutPlatz:nil];
    22. [self setOutFaktor:nil];
    23. [self setOutErgebnis:nil];
    24. [super viewDidUnload];
    25. // Release any retained subviews of the main view.
    26. // e.g. self.myOutlet = nil;
    27. }
    28. - (void)viewWillAppear:(BOOL)animated
    29. {
    30. [super viewWillAppear:animated];
    31. }
    32. - (void)viewDidAppear:(BOOL)animated
    33. {
    34. [super viewDidAppear:animated];
    35. }
    36. - (void)viewWillDisappear:(BOOL)animated
    37. {
    38. [super viewWillDisappear:animated];
    39. }
    40. - (void)viewDidDisappear:(BOOL)animated
    41. {
    42. [super viewDidDisappear:animated];
    43. }
    44. - (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
    45. {
    46. // Return YES for supported orientations
    47. return (interfaceOrientation != UIInterfaceOrientationPortraitUpsideDown);
    48. }
    49. - (IBAction)textFieldDoneEditing:(id)sender{
    50. [sender resignFirstResponder];
    51. }
    52. - (IBAction)klick:(id)sender {
    53. NSNumberFormatter *formatter = [[NSNumberFormatter new] autorelease];
    54. [formatter setLocale:[[[NSLocale alloc] initWithLocaleIdentifier:@"de_DE"] autorelease]];
    55. NSString *eingabefaktor = outFaktor.text;
    56. NSNumber *number = [formatter numberFromString:eingabefaktor];
    57. float umwandlung =[number floatValue];
    58. float result = umwandlung * 100 * (( [outAnzahl.text floatValue] + 1 - [outPlatz.text floatValue]) / [outAnzahl.text floatValue]);
    59. outErgebnis.text = [NSString stringWithFormat:@"%f",result];
    60. }
    61. - (void)dealloc {
    62. [outAnzahl release];
    63. [outPlatz release];
    64. [outFaktor release];
    65. [outErgebnis release];
    66. [super dealloc];
    67. }
    68. @end
    Alles anzeigen





    Schon mal vielen Dank im Voraus
  • robin_ schrieb:

    Wenn er schreibt über Cydia (= Jailbreak) dann heißt es doch, dass es kein Developer-Account hat

    Was hat das Eine mit dem Anderen zu tun? Es mag ja sein, dass dem so ist, ich könnte dies allerdings aus dem Post nur raten ...

    @OP: Wenn dem so ist, solltest Du Dich mal auf die Suche nach den Crashlogs Deiner App auf dem Gerät begeben und sie analysieren.
  • Erstmal vielen Dank für das Interesse.
    Um ein pah Fagen zu klären:
    1.Nein ich habe (noch) keinen Developer-Account.
    2. Ich habe die App über Lydia (genauer über SSH) auf das iPhone installiert, weil ich keine andere Möglichkeit habe.

    Außerdem hier noch ein Crashlog vom Absturz

    Quellcode

    1. Incident Identifier: 1C0C6525-BEA4-493F-B0AA-276597A0C06CCrashReporter Key: 2eafbe29460418eaeb13a5192ae2fdcc2f3acdcdHardware Model: iPhone2,1Process: Ranglistenrechner [453]Path: /Applications/Ranglistenrechner.app/RanglistenrechnerIdentifier: RanglistenrechnerVersion: ??? (???)Code Type: ARM (Native)Parent Process: punchd [1]
    2. Date/Time: 2012-05-12 00:09:25.224 +0200OS Version: iPhone OS 4.2.1 (8C148a)Report Version: 104
    3. Exception Type: EXC_BREAKPOINT (SIGTRAP)Exception Codes: 0x00000001, 0xe7ffdefeCrashed Thread: 0
    4. Dyld Error Message: Symbol not found: _objc_autoreleasePoolPush Referenced from: /Applications/Ranglistenrechner.app/Ranglistenrechner Expected in: /usr/lib/libobjc.A.dylib Dyld Version: 179.7
    5. Thread 0 Crashed:0 dyld 0x2feb8080 dyld_fatal_error + 01 dyld 0x2feb9830 dyld::halt(char const*) + 482 dyld 0x2feb98da dyld::fastBindLazySymbol(ImageLoader**, unsigned long) + 1503 libSystem.B.dylib 0x3121159a _dyld_fast_stub_entry(void*, long) + 304 libSystem.B.dylib 0x31211504 dyld_stub_binder + 125 Ranglistenrechner 0x000b9eba main (main.m:13)6 Ranglistenrechner 0x000b9ea8 0xb8000 + 7848
    6. Thread 1:0 libSystem.B.dylib 0x31192974 kevent + 241 libSystem.B.dylib 0x3123c704 _dispatch_mgr_invoke + 882 libSystem.B.dylib 0x3123c174 _dispatch_queue_invoke + 963 libSystem.B.dylib 0x3123bb98 _dispatch_worker_thread2 + 1204 libSystem.B.dylib 0x311e024a _pthread_wqthread + 2585 libSystem.B.dylib 0x311d8970 start_wqthread + 0
    7. Thread 2:0 libSystem.B.dylib 0x311e09e0 __workq_kernreturn + 81 libSystem.B.dylib 0x311e0364 _pthread_wqthread + 5402 libSystem.B.dylib 0x311d8970 start_wqthread + 0
    8. Thread 0 crashed with ARM Thread State: r0: 0x2fedfc70 r1: 0x00000000 r2: 0x00000362 r3: 0x2fedfc20 r4: 0x2fedfc70 r5: 0x1d53d06c r6: 0x2fed18a5 r7: 0x2feb6bf0 r8: 0x2fee21b4 r9: 0x00000000 r10: 0x2feb6bd4 r11: 0x000bc2f5 ip: 0x2fedfd0e sp: 0x2feb6bf0 lr: 0x2feb9837 pc: 0x2feb8080 cpsr: 0x60000010
    9. Binary Images: 0xb8000 - 0xbafff +Ranglistenrechner armv7 <672a0235b66c376fb4723aea2dc1559c> /Applications/Ranglistenrechner.app/Ranglistenrechner 0xbe000 - 0xbefff +MobileSubstrate.dylib armv6 <b8a484a95b5d30c5ab59f25362558e7c> /Library/MobileSubstrate/MobileSubstrate.dylib 0xe5000 - 0xe6fff +SubstrateLoader.dylib armv6 <885b4713fd433c3996edfc3552109041> /Library/Frameworks/CydiaSubstrate.framework/Libraries/SubstrateLoader.dylib 0x10a000 - 0x10bfff dns.so armv7 <fcefecb2d5e095ba88127eec3af57ec0> /usr/lib/info/dns.so 0x1a8000 - 0x1b4fff +Activator.dylib armv6 <22da11ddbca43147a9a7880a0e78c88b> /Library/MobileSubstrate/DynamicLibraries/Activator.dylib 0x1bc000 - 0x1c0fff +IntelliStatusIconsView.dylib armv6 <915699e8cb5c1a129984cec679515c50> /Library/MobileSubstrate/DynamicLibraries/IntelliStatusIconsView.dylib0x2feb7000 - 0x2fedefff dyld armv7 <06e6959cebb4a72e66c833e26ae64d26> /usr/lib/dyld0x30122000 - 0x30177fff libvDSP.dylib armv7 <9365fc6cae1bff737257e74faf3b1f26> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libvDSP.dylib0x3019a000 - 0x301e4fff libstdc++.6.dylib armv7 <53a6e7239c3908fa8c2915b65ff3b056> /usr/lib/libstdc++.6.dylib0x3024e000 - 0x302fdfff WebKit armv7 <644a1c6120578f896bed7121307aa2af> /System/Library/PrivateFrameworks/WebKit.framework/WebKit0x30319000 - 0x30320fff libbz2.1.0.dylib armv7 <2989ea7a5cad2cfe91bd632b041d0ff4> /usr/lib/libbz2.1.0.dylib0x3033c000 - 0x30429fff libiconv.2.dylib armv7 <c72b45f471df092dbd849081f7a3ef53> /usr/lib/libiconv.2.dylib0x30569000 - 0x3056afff CoreSurface armv7 <f7caaf43609cfe0e475dfe83790edb4d> /System/Library/PrivateFrameworks/CoreSurface.framework/CoreSurface0x30746000 - 0x3074ffff CoreVideo armv7 <2092d5deb6b234e04678b7c1878ccd81> /System/Library/Frameworks/CoreVideo.framework/CoreVideo0x30750000 - 0x3075bfff libz.1.dylib armv7 <fabaddbcbc8c02bab0261df9d78e0e25> /usr/lib/libz.1.dylib0x3075f000 - 0x30761fff MobileInstallation armv7 <8e6b0d9f642be06729ffdaaee97053b0> /System/Library/PrivateFrameworks/MobileInstallation.framework/MobileInstallation0x3079d000 - 0x307a3fff liblockdown.dylib armv7 <5bbd9b3f5cfece328f80c403a8805ce9> /usr/lib/liblockdown.dylib0x309e4000 - 0x30a16fff AppSupport armv7 <47c8055ac99f187174ca373b702ffa68> /System/Library/PrivateFrameworks/AppSupport.framework/AppSupport0x30a1d000 - 0x30a54fff Security armv7 <cd28e102950634ae7167ddee9c686d36> /System/Library/Frameworks/Security.framework/Security0x30a5d000 - 0x30b0bfff QuartzCore armv7 <83a8e5f0033369e437069c1e758fed83> /System/Library/Frameworks/QuartzCore.framework/QuartzCore0x30d54000 - 0x30d61fff libbsm.0.dylib armv7 <0f4e595e6eb2170aceb729f32b5de8c2> /usr/lib/libbsm.0.dylib0x30faf000 - 0x30feefff libGLImage.dylib armv7 <a7c117c92607a512823d307b8fdd0151> /System/Library/Frameworks/OpenGLES.framework/libGLImage.dylib0x31020000 - 0x3102cfff SpringBoardServices armv7 <137b75e19b2450c234dec88d538798ff> /System/Library/PrivateFrameworks/SpringBoardServices.framework/SpringBoardServices0x31077000 - 0x3115ffff libGLProgrammability.dylib armv7 <1f478a71783cd7eb4ae9ef6f2dcea803> /System/Library/Frameworks/OpenGLES.framework/libGLProgrammability.dylib0x31160000 - 0x31163fff IOSurface armv7 <deff02882166bf16d0765d68f0542cc8> /System/Library/PrivateFrameworks/IOSurface.framework/IOSurface0x31165000 - 0x31276fff libSystem.B.dylib armv7 <138a43ab528bb428651e6aa7a2a7293c> /usr/lib/libSystem.B.dylib0x31337000 - 0x31371fff IOKit armv7 <eb932cc42d60e55d9a4d0691bcc3d9ad> /System/Library/Frameworks/IOKit.framework/Versions/A/IOKit0x31425000 - 0x31429fff AssetsLibraryServices armv7 <e861a330d14702f148ca5133dcbe954c> /System/Library/PrivateFrameworks/AssetsLibraryServices.framework/AssetsLibraryServices0x31430000 - 0x31516fff CoreFoundation armv7 <01441e01f5141a50ee723362e59ca400> /System/Library/Frameworks/CoreFoundation.framework/CoreFoundation0x31517000 - 0x31519fff IOMobileFramebuffer armv7 <1040629f37795146c9dcac8ab1a868fc> /System/Library/PrivateFrameworks/IOMobileFramebuffer.framework/IOMobileFramebuffer0x31549000 - 0x3154cfff CaptiveNetwork armv7 <a2af7147f5538d7669b14fa7b19b5a7c> /System/Library/PrivateFrameworks/CaptiveNetwork.framework/CaptiveNetwork0x3155c000 - 0x3167cfff CoreGraphics armv7 <2d7b40a7baca915ce78b1dd9a0d6433b> /System/Library/Frameworks/CoreGraphics.framework/CoreGraphics0x31703000 - 0x31705fff libgcc_s.1.dylib armv7 <e66758bcda6da5d7f9b54fa5c4de6da2> /usr/lib/libgcc_s.1.dylib0x3187b000 - 0x31991fff libicucore.A.dylib armv7 <e7fbb2ac586567e574dc33d7bb5c4dc9> /usr/lib/libicucore.A.dylib0x3199c000 - 0x31a5dfff libobjc.A.dylib armv7 <aaf5671a35f9ac20d5846703dafaf4c6> /usr/lib/libobjc.A.dylib0x31a7d000 - 0x31a8afff OpenGLES armv7 <a12565ffb5bb42e3019f1957cd4951d0> /System/Library/Frameworks/OpenGLES.framework/OpenGLES0x31ae0000 - 0x31ae3fff libGFXShared.dylib armv7 <3a385ed495379116abbe50bc8cd5a612> /System/Library/Frameworks/OpenGLES.framework/libGFXShared.dylib0x31b29000 - 0x31b52fff MobileCoreServices armv7 <54484a513761868149405df7fc29b5c0> /System/Library/Frameworks/MobileCoreServices.framework/MobileCoreServices0x31b58000 - 0x31b5ffff AggregateDictionary armv7 <71372c95d4af7af787d0682a939e40ac>
  • hier noch der Rest:

    Quellcode

    1. /System/Library/PrivateFrameworks/AggregateDictionary.framework/AggregateDictionary0x31bcc000 - 0x31be1fff libresolv.9.dylib armv7 <ea156820997ae9a2baf664d0f79f18d7> /usr/lib/libresolv.9.dylib0x31cc4000 - 0x31de3fff Foundation armv7 <81d36041f04318cb51db5aafed9ce504> /System/Library/Frameworks/Foundation.framework/Foundation0x31e18000 - 0x31e63fff libBLAS.dylib armv7 <251c5ac7380802a16e30d827c027c637> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libBLAS.dylib0x33886000 - 0x3389cfff EAP8021X armv7 <36659ec2b9def7b5798a05327e369247> /System/Library/PrivateFrameworks/EAP8021X.framework/EAP8021X0x3389e000 - 0x33c1ffff UIKit armv7 <de1cbd3219a74e4d41b30428f428e223> /System/Library/Frameworks/UIKit.framework/UIKit0x33ce8000 - 0x342d0fff WebCore armv7 <d6bd9cf88ee82ab6b0e33e0ae1190772> /System/Library/PrivateFrameworks/WebCore.framework/WebCore0x343e6000 - 0x34405fff Bom armv7 <0f5fd6057bad5e1677869500d636821f> /System/Library/PrivateFrameworks/Bom.framework/Bom0x344ea000 - 0x34623fff AudioToolbox armv7 <657b327f2ceee9f22f9474f2f9bddbe6> /System/Library/Frameworks/AudioToolbox.framework/AudioToolbox0x34628000 - 0x34628fff Accelerate armv7 <29dd5f17440bbb6e8e42e11b6fceda9a> /System/Library/Frameworks/Accelerate.framework/Accelerate0x34641000 - 0x34700fff CFNetwork armv7 <02fe0e30e54fffdcbbbd02e8cb812c3a> /System/Library/Frameworks/CFNetwork.framework/CFNetwork0x34952000 - 0x3495afff MobileWiFi armv7 <b29d4c5e300ef81060e38f72bb583c02> /System/Library/PrivateFrameworks/MobileWiFi.framework/MobileWiFi0x3495b000 - 0x34bf5fff libLAPACK.dylib armv7 <2e77d87e96af938aacf0a6008e6fb89d> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/libLAPACK.dylib0x34bf6000 - 0x34c36fff CoreAudio armv7 <f32e03ee4c68f0db23f05afc9a3cc94c> /System/Library/Frameworks/CoreAudio.framework/CoreAudio0x35336000 - 0x353dffff libxml2.2.dylib armv7 <b3d82f80a777cb1434052ea2d232e3df> /usr/lib/libxml2.2.dylib0x353e1000 - 0x3548efff JavaScriptCore armv7 <3f2df600942dc72aad312b3cc98ec479> /System/Library/PrivateFrameworks/JavaScriptCore.framework/JavaScriptCore0x354b4000 - 0x354bcfff libkxld.dylib armv7 <854e82fe66feef01e54c7c8a209851ac> /usr/lib/system/libkxld.dylib0x354d9000 - 0x354f9fff PrintKit armv7 <02a9c6f4173a0673c4637a3b570345cd> /System/Library/PrivateFrameworks/PrintKit.framework/PrintKit0x354fa000 - 0x3553cfff CoreTelephony armv7 <96d3af505b9f2887e62c7e99c157733e> /System/Library/Frameworks/CoreTelephony.framework/CoreTelephony0x3553d000 - 0x3558afff libsqlite3.dylib armv7 <55038e5c1d4d0dbdd94295e8cad7a9a4> /usr/lib/libsqlite3.dylib0x35a37000 - 0x35a3cfff MobileKeyBag armv7 <cec3f3271fc267c32c169ed03e312d63> /System/Library/PrivateFrameworks/MobileKeyBag.framework/MobileKeyBag0x35a95000 - 0x35a95fff vecLib armv7 <e53d234e808c77d286161095f92c58cf> /System/Library/Frameworks/Accelerate.framework/Frameworks/vecLib.framework/vecLib0x35bcc000 - 0x35bfbfff SystemConfiguration armv7 <3f982c11b5526fc39a92d585c60d8a90> /System/Library/Frameworks/SystemConfiguration.framework/SystemConfiguration0x35ca1000 - 0x35d10fff ProofReader armv7 <d2e62a8ab7e1460c7f6de8913c703e6d> /System/Library/PrivateFrameworks/ProofReader.framework/ProofReader0x35d62000 - 0x35d6efff GraphicsServices armv7 <0099670dccd99466653956bf918d667a> /System/Library/PrivateFrameworks/GraphicsServices.framework/GraphicsServices0x35db1000 - 0x35e44fff ImageIO armv7 <5b5a294d4250eff866fdbf891b1e8b34> /System/Library/Frameworks/ImageIO.framework/ImageIO0x35e52000 - 0x35e85fff AddressBook armv7 <7c87e0175c8649d6832419da8a1cfac1> /System/Library/Frameworks/AddressBook.framework/AddressBook0x35f86000 - 0x35fbcfff CoreText armv7 <b9b5c21b2d2a28abc47842c78c026ddf> /System/Library/Frameworks/CoreText.framework/CoreText0x35fbd000 - 0x35fbffff libAccessibility.dylib armv7 <3f0b58ea13d30f0cdb73f6ffe6d4e75c> /usr/lib/libAccessibility.dylib
  • Och Mensch, das kann doch keiner lesen. So sah das doch im CrashLog auch nicht aus, oder? Da war das schön untereinander und nicht bandwurmmäßig.
    Was ich aus diesem Bleisalat erkenne: a) Thread 0 is gecrashed und b) Du hast das CrashLog nicht symbolisiert.

    Sorry, aber wie willst Du Software entwickeln, wenn Du Dich auf den Jailbreak-Schrott verlässt und nicht einmal ein Dev-Account abschließt? Na, egal.
  • Hi
    Uups in der Vorschau sahs anders aus.
    Na ja auf jedem fall hab ich die .crash Datei mal exportiert.

    Ich hab noch keinen Developer Account weil erstmal probieren wollte ob mir das ganze gefällt.
    Ich werde mir wahrscheinlich auch bald einen Account kaufen.
  • Schwer zu sagen. Im Grunde scheint irgendwo eine Exception geworfen zu werden, die Du nicht abfängst. Oder es ist was ganz Anderes. Dass im Simulator läuft und auf dem Device nicht deutet m.E. darauf hin, dass Du ein Memory-Management-Problem hast.

    Aber das hier ist beides definitiv falsch:

    Quellcode

    1. [self setOutAnzahl:nil];
    2. [self setOutPlatz:nil];
    3. [self setOutFaktor:nil];
    4. [self setOutErgebnis:nil];

    Was Du willst ist vermutlich, die Feldinhalte zu löschen. Was Du tust ist aber, die Objekte zu löschen. Und das gefällt iOS gar nicht, denn Du hast die ganze Verdrahtung mit einem XIB file (Stichwort: IBOutlet) vorgenommen. Richtig wäre:

    Quellcode

    1. [[self outAnzahl] setText:@""];
    2. [[self outPlatz] setText:@""];
    3. [[self outFaktor] setText:@""];
    4. [[self outErgebnis] setText:@""];

    Aus demselben Grund (Du fuhrwerkst in IB-Verbindungen herum) ist dieser Teil in dealloc auch falsch - löschen!:

    Quellcode

    1. [outAnzahl release];
    2. [outPlatz release];
    3. [outFaktor release];
    4. [outErgebnis release];


    Wenn Du es mal mit diesen Änderungen versucht, könnte Dein Problem schon behoben sein.
  • fwtag schrieb:

    Aber das hier ist beides definitiv falsch:

    Quellcode

    1. [self setOutAnzahl:nil];
    2. [self setOutPlatz:nil];
    3. [self setOutFaktor:nil];
    4. [self setOutErgebnis:nil];


    Aus demselben Grund (Du fuhrwerkst in IB-Verbindungen herum) ist dieser Teil in dealloc auch falsch - löschen!:

    Quellcode

    1. [outAnzahl release];
    2. [outPlatz release];
    3. [outFaktor release];
    4. [outErgebnis release];

    Autsch. Nein, all das ist absolut korrekt! In viewDidUnload soll man alles freigeben, was man problemlos wieder herstellen kann. Für Verbindungen im Interface Builder gelten die gleichen Speicherverwaltungsregeln.

    Michael
  • Ich mag mich ja irren, aber "ich" bin nur Eigentümer des ViewControllers, den "ich" zu Beginn allokiert und initialisiert habe. Daher darf "ich" auch nur den ViewController releasen - die Outlets wurden aber nicht von "mir" allokiert/initialisiert, sondern von "... initWithNibFile:". Also darf "ich" die auch nicht releasen, weil sie "mir" gar nicht (explizit) gehören.
  • Ok
    Ich hab den Fehler jetzt gefunden.
    Eigentlich peinlich dass ich da nicht früher draufgekommen bin.
    Xcode hat automatisch für Deployment Target 5.0 eingestellt.
    Aber da ich die App per SSH auf ein iPhone mit iOS 4.2.1 installiert habe, ist sie sofort nach dem laden abgestürzt.

    Jetzt hab ich als Deployment Target 3.0 eingestellt und jetzt funktioniert sie.

    Also vielen Dank für die Hilfe
  • fwtag schrieb:

    Ich mag mich ja irren, aber "ich" bin nur Eigentümer des ViewControllers, den "ich" zu Beginn allokiert und initialisiert habe. Daher darf "ich" auch nur den ViewController releasen - die Outlets wurden aber nicht von "mir" allokiert/initialisiert, sondern von "... initWithNibFile:". Also darf "ich" die auch nicht releasen, weil sie "mir" gar nicht (explizit) gehören.

    Du irrst Dich. Die Outlets sind hier mit dem Attribut retain deklariert. Deshalb bist Du auch Eigentümer der Outlets.

    Michael
  • OK, wieder was gelernt - wenngleich das auch nur recht theoretischer Natur im Zusammenhang mit MemoryWarnings ist:
    Because outlets to elements within the nib file are typically retained, however, even though the main view is disposed of, absent any further action the outlets are not disposed of. This is not in and of itself a problem—if and when the main view is reloaded, they will simply be replaced—but it does mean that the beneficial effect of the didReceiveMemoryWarning is reduced. To ensure that you properly relinquish ownership of outlets, in your custom view controller class you can implement viewDidUnload to invoke your accessor methods to set outlets to nil.