Results 1 to 9 of 9
Discuss [2.0][Toolchain] Problems with UIApplicationMain at the iPhone Developer Exchange - Hackint0sh.org; Hi guys, I'm working on porting my apps to 2.0 and everything compiles fine. I ...
  1. #1
    Newbie Array

    Join Date
    Jan 2008
    Posts
    8
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default [2.0][Toolchain] Problems with UIApplicationMain

    Hi guys,

    I'm working on porting my apps to 2.0 and everything compiles fine. I got one problem that I can't figure out though. When I start my apps they just hangs after UIApplicationMain is called. Has anyone experienced this?

    Code:
    int main(int argc, char **argv)
    {
        NSAutoreleasePool *autoreleasePool = [[ NSAutoreleasePool alloc ] init];
    
        NSLog(@"Starting UI...");
        int returnCode = UIApplicationMain(argc, argv, @"Blockee", @"Blockee");
        [ autoreleasePool release ];
        return returnCode;
    }
    All I basically can see is the "Starting UI..." text, my next NSLog-checkpoint is in applicationDidFinishLaunching but it never fires and nothing happends on SpringBoard, it just hangs.



  2. #2
    Rookie Array

    Join Date
    Jul 2008
    Posts
    25
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    how are you launching the app?

  3. #3
    Newbie Array

    Join Date
    Jan 2008
    Posts
    8
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    I've tried to launch it from both command-line and springboard. When I launch it from SP it just quits right away without writing anything to the crashlogs. From command-line nothing happends after showing the "Starting UI..." message, it just hangs. The permissions on the executable is 777. It seems like there is something bogus about the way I launch UIApplication, but I can't see what I'm doing wrong compared to the NES.app for example. I compiled this on the phone itself btw, I'm not sure if that might have something to do with it.
    Last edited by kman1; 07-23-2008 at 06:53 PM.
    www.polleo.no - Polleo Limited

  4. #4
    Professional Array

    Join Date
    Feb 2008
    Posts
    69
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    10

    Default

    I've adapted this one (thanks to javacom for the link to the example) to 2.0 and worked well for me.

    int main(int argc, char *argv[]) {
    int returnCode;
    NSAutoreleasePool *pool = [ [ NSAutoreleasePool alloc ] init ];
    returnCode = UIApplicationMain(argc, argv, @"HelloWorldApp", @"HelloWorldApp");
    [ pool release ];
    return returnCode;
    }

  5. #5
    Newbie Array

    Join Date
    Jan 2008
    Posts
    8
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Etiennez0r: Is it possible for you to zip that HelloWorld sample of yours and upload it to a webpage?


  6. #6
    Professional Array

    Join Date
    Feb 2008
    Posts
    69
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    10

    Default Helloword for 2.0

    Hi kman1, there is the original example that i've adapted in my post above. I've done that just following this toolchain 2.0 documentation. This appears on your springboard after you install the toolchain with cydia.

    If you need other help just ask, and thumbs up if i've helped.

  7. #7
    Rookie Array

    Join Date
    Nov 2007
    Posts
    14
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default

    Quote Originally Posted by kman1 View Post
    I've tried to launch it from both command-line and springboard. When I launch it from SP it just quits right away without writing anything to the crashlogs. From command-line nothing happends after showing the "Starting UI..." message, it just hangs. The permissions on the executable is 777. It seems like there is something bogus about the way I launch UIApplication, but I can't see what I'm doing wrong compared to the NES.app for example. I compiled this on the phone itself btw, I'm not sure if that might have something to do with it.
    I had the similar problem. First i put my sources to /var/mobile/..., and after successfull compilation/ldid app crashed after launch.
    But then i copied sources to /Applications/name.app/src, compiled again, ldid-ed.
    And it worked fine! Please also remember that you shoudl ldid your app ONLY ONCE.

  8. #8
    Newbie Array

    Join Date
    Dec 2007
    Posts
    6
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    0

    Default Problems with UIApplicationMain

    I have the exact same problem. Did you ever solve this??

    I have a really simple program (stripped down version of the HelloWorld app) and I am using UIApplicationMain as Etiennez0r, but the app hangs after call to UIApplicationMain.

    Ok, that's not exactly true - I implemented the init method in my UIApplication subclass - and this gets called. applicationDidFinishLaunching is, however, never called.

    Sincerely,
    /morten

  9. #9
    Senior Professional Array

    Join Date
    Sep 2007
    Posts
    148
    Post Thanks / Like
    Downloads
    0
    Uploads
    0
    Rep Power
    16

    Default

    Morten,

    Make sure:

    1. Your app has exectuable permissions
    2. After you upload your app to the phone, run ldid -S on it (only once and do not attempt to run the app before doing ldid)
    3. Make sure you have a proper plist in the same directory.

    e.g.
    Code:
    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
    <plist version="1.0">
    <dict>
    	<key>CFBundleDevelopmentRegion</key>
    	<string>en</string>
    	<key>CFBundleName</key>
    	<string>WifiToggle</string>
    	<key>CFBundleExecutable</key>
    	<string>WifiToggle</string>
    	<key>CFBundleIdentifier</key>
    	<string>com.gojohnnyboi.wifitoggle</string>
    	<key>CFBundleInfoDictionaryVersion</key>
    	<string>0.1</string>
    	<key>CFBundlePackageType</key>
    	<string>APPL</string>
    	<key>CFBundleShortVersionString</key>
    	<string>1.0.0</string>
    	<key>CFBundleSignature</key>
    	<string>????</string>
    	<key>CFBundleVersion</key>
    	<string>2.0</string>
    </dict>
    </plist>
    PmgR
    =============================================
    Help stop the persecution of Falun Dafa in China!
    Stop organ harvesting from living people in China's labor camps
    http://www.faluninfo.net
    http://www.theepochtimes.com/211,111,,1.html
    =============================================
    Falun Dafa, an ancient Chinese self-cultivation practice,
    based on the principles of
    * Truthfulness * Compassion * Tolerance *
    http://www.falundafa.org
    =============================================

 

 

Similar Threads

  1. [Toolchain Question] Unable to compile UI App in toolchain
    By sireko in forum Free Toolchain Software (Cydia App's)
    Replies: 1
    Last Post: 06-26-2009, 10:31 PM
  2. (Toolchain) New VMWare Community Toolchain (2.0)
    By Shade.sh in forum Free Toolchain Software (Cydia App's)
    Replies: 2
    Last Post: 10-20-2008, 10:14 PM
  3. windows toolchain problems
    By lazrhog in forum Tools
    Replies: 3
    Last Post: 01-14-2008, 09:33 PM
  4. windows toolchain problems
    By lazrhog in forum Free Toolchain Software (Cydia App's)
    Replies: 2
    Last Post: 01-11-2008, 02:46 PM
  5. Replies: 0
    Last Post: 09-18-2007, 08:51 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Powered by vBulletin®
Copyright © 2014 vBulletin Solutions, Inc. All rights reserved.
Search Engine Friendly URLs by vBSEO
(c) 2006-2012 Hackint0sh.org
All times are GMT +2. The time now is 09:55 AM.
twitter, follow us!