mainwindow not visible

Discussion in 'iOS Development' started by acca2o, Oct 15, 2009.

  1. acca2o

    acca2o New Member

    Joined:
    Sep 26, 2009
    Messages:
    51
    Likes Received:
    0
    Device:
    2G iPod touch
    Ok, slowly I'm overcaming the first application and the toolchain.
    Now...
    I wrote my main, MyApp class (.m and .h)
    I compiled them without errors or warnings and copied the folder on IPOD TOUCH 2g 3.0.
    chmod 755 on folder and files, then by ldid the application have been signed.
    killall SpringBoard and teh icon is there.
    I touch it, the application opens for some seconds then closes.
    I just can see the Defaut.png background for 3-4 seconds and the application closes.
    Why?
    Why can't I see the yellow mainWindow I set in the code?

    This are my main and MyApp class:


    main.m


    MyApp.h


    MyApp.m

    ------------------double post merged------------------
    I read somewhere in the web that with SDK for 3.0 I have to cancel the line:

    UIWindow *mainWindow = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

    because the mainwindow is setup by the sdk.

    But I'm using the open toolchain (for 3.0 ipod).
    Is it the same?

    If I cancel the line I get an error because the mainwindow (or juste window) object has no instantiated.

    Please help me, it's blocking - no window, no party

    Please Register or Log in to view images

  2. Collateral

    Collateral Active Member

    Joined:
    Sep 23, 2007
    Messages:
    1,974
    Likes Received:
    6
    Device:
    iPhone 3GS (Black)
    Use mobile terminal to codesign the app.

    ldid -s Application
  3. acca2o

    acca2o New Member

    Joined:
    Sep 26, 2009
    Messages:
    51
    Likes Received:
    0
    Device:
    2G iPod touch
    But...I already signed the application by putty or winscp (console) with ldid -S Application (permission set to 755 by chmod on the device)
    What's the difference with mobile terminal?

    I think ldid has worked well: before signing, IPOD kill the application in a nano second.
    After ldid it takes some seconds.

    Another question: my application preently doesn't do anything. So I think that maybe it closes because finished to work. Am I wrong?
  4. Collateral

    Collateral Active Member

    Joined:
    Sep 23, 2007
    Messages:
    1,974
    Likes Received:
    6
    Device:
    iPhone 3GS (Black)
    [OBJC]- (void)applicationDidFinishLaunching: (UIApplication *)application;
    @end[/OBJC]

    Yea i think it may be because it hits "didfinishlaunching" and reaches the end of the code. So it exits.
  5. acca2o

    acca2o New Member

    Joined:
    Sep 26, 2009
    Messages:
    51
    Likes Received:
    0
    Device:
    2G iPod touch
    but in that case I expect that I can see for few seconds the yellow window,not?

    I understand that once the window is built the application wait for events and close with the home button event, wrong?

    What can I do to test? adding a view?
  6. Collateral

    Collateral Active Member

    Joined:
    Sep 23, 2007
    Messages:
    1,974
    Likes Received:
    6
    Device:
    iPhone 3GS (Black)
    i agree with you.

    Like in my opinion, it looks like it should work. I dont see anything OBVIOUSLY wrong with your code.

    :/ Are you getting any warnings or errors?
  7. acca2o

    acca2o New Member

    Joined:
    Sep 26, 2009
    Messages:
    51
    Likes Received:
    0
    Device:
    2G iPod touch
    yes, non errors o warnings.
    The worst case of problem...when you don't know where to loot for...
    Have I to downgrade to 2.1?
  8. Collateral

    Collateral Active Member

    Joined:
    Sep 23, 2007
    Messages:
    1,974
    Likes Received:
    6
    Device:
    iPhone 3GS (Black)
    no, i mean theres no reason to go below 3.0, everything is coded for 3.0+ now..
  9. acca2o

    acca2o New Member

    Joined:
    Sep 26, 2009
    Messages:
    51
    Likes Received:
    0
    Device:
    2G iPod touch
    yes, but if I can't solve this problem I can't do anything more than open a close an application.
    It's one week I'm looking on the net...just one post about this problem.
    It say to cancel the code line where I alloc the main window because the sdk build it.
    But I tried and got a error because I use an objet never instantiated.
  10. Collateral

    Collateral Active Member

    Joined:
    Sep 23, 2007
    Messages:
    1,974
    Likes Received:
    6
    Device:
    iPhone 3GS (Black)
    thats because your not using the sdk

Share This Page