[iPhone] Getting non-Nib simple app to work

Dear Experts,
I'm having trouble getting a trivial application with no Nib file to work.
One key thing is the need to pass the name of the AppDelegate class as the last parameter to UIApplicationMain(). Yet it still doesn't do anything. Here's the code:
main.m:
#import <UIKit/UIKit.h>
int main(int argc, char *argv[])
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"HelloWorldAppDelegate");
[pool release];
return retVal;
HelloWorldAppDelegate.h:
#import <UIKit/UIKit.h>
@interface HelloWorldAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow* window;
@end
HelloWorldAppDelegate.m:
#import "HelloWorldAppDelegate.h"
@implementation HelloWorldAppDelegate
- (void)applicationDidFinishLaunching:(UIApplication *)application {
window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
window.backgroundColor = [UIColor whiteColor];
[window makeKeyAndVisible];
- (void)dealloc {
[window release];
[super dealloc];
@end
All that that should do is create a window with a white background. When I run it in the simulator I just see a blank black background. Attempts to add other content as subviews of the window also result in nothing being visible.
I think that I must be missing some other bit of fundamental "plumbing" somewhere that would have been done for me my the nib file in a project that had one. Does anyone have any clues? Can anyone point me to some sample code that doesn't use a nib file? According to the debugger, my applicationDidFinishLaunching is being run.
Thanks in advance!
Phil.

Thanks for the hint; here's the code again:
main.m:
#import <UIKit/UIKit.h>
int main(int argc, char *argv[])
NSAutoreleasePool * pool = [[NSAutoreleasePool alloc] init];
int retVal = UIApplicationMain(argc, argv, nil, @"HelloWorldAppDelegate");
[pool release];
return retVal;
HelloWorldAppDelegate.h:
#import <UIKit/UIKit.h>
@interface HelloWorldAppDelegate : NSObject <UIApplicationDelegate> {
UIWindow* window;
@end
HelloWorldAppDelegate.m
#import "HelloWorldAppDelegate.h"
@implementation HelloWorldAppDelegate
- (void)applicationDidFinishLaunching:(UIApplication *)application {
window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];
window.backgroundColor = [UIColor whiteColor];
[window makeKeyAndVisible];
- (void)dealloc {
[window release];
[super dealloc];
@end

Similar Messages

  • I own an iPhone 4S and have installed ios8. Subsequently none of my apps will work. How do I uninstall and go back to the previous operating system?

    I own an iPhone 4S and have installed ios8. Subsequently none of my apps will work. How do I uninstall and go back to the previous operating system?

    Good luck at the Genius bar.
    I have figured out that if I do a hard restart of the phone the apps will work for a time, but then they begin to all freeze up again after a short time.
    This may be a problem of not enough free storage. Have you checked the storage used by your apps?
      Go to Settings > General > Usage

  • I can't get the yahoo messenger app to work on my phone, all it does is show is "connecting" and I appear on-line to my contacts.

    I can not get the yahoo messenger app to work on my iphone.

    Same problem here!
    I'm using the latest in Chrome, Firefox, and IE 8, regular and compatibility mode.  This is extremely frustrating, one of the primary reasons I bought this printer was for the mobile/eprint functions.

  • My apps don't work/after update/4th/ did up dates yesterday, now none of my apps are working. When click on them my screen blicks

    When I did updates last night about videos. Now non of my apps are working. When I click on them the screen blicks on and off. Everything else see fine.

    - Have you tried to reset yur iPod?
    Press and hold the On/Off Sleep/Wake button and the Home
    button at the same time for at least ten seconds, until the Apple logo appears.
    -Next would be to restore the iPod from backup via iTunes
    - Last would be to restore you iPod to factory defaults/new iPod via iTunes since there may be corruption that is in your backup.

  • Has anybody succeeded in getting the Scrabble tiles app to work with Scrabble?  I am also having difficulty getting an iPod Touch to connect to an iPad via BlueTooth

    Has anybody succeeded in getting the Scrabble tiles app to work with Scrabble?  I also have difficulty in linking an iPod Touch with an iPad via Blue Tooth.  Any suggestions welcome!

    You can pair one iOS device to another iOS device at least two ways:
    - Via app that use BT for peer-to-peer gaming
    - By a general purpose app like
    App Store - Bluetooth FileShare

  • How do you get the jukester jukebox app to work vertically so I can use in a tabletop jukebox machine

    How do I get the jukester jukebox app to work vertically instead of horizontally-so I can use it in a jukebox?

    If other apps can rotate and use vertically then the Jukebox developer did not include this functionality.
    Write to them:
    http://www.jukesterjukebox.com

  • How do I get the remote control app to work for a Sony HDD Hi Res audio player?

    Can't get the iPhone remote control app to work for my HDD Hi Res Audio player.  The app can "find" the player and I can turn on the power with the app but then can't get it to go to my music - can only use the "demo" tool with the demo info. What am I doing wrong?

    Good day cb94!
    I'd like to see if I can assist you with the Hi-Res Audio player. Please provide us the model, use this link to verify the model: http://esupport.sony.com/ Thank you! - Paul

  • My Droid will not power on.  Yesterday none of the apps would work and today. Nothing at all.

    Yesterday, none of the apps on my phone would work.  Texting and calls went through fine.  This morning I woke up with the initial set up screen showing, I went through the process but, still had no access to apps.  About an hour later, the phone shut off and will not come back on.  What happened and how do I fix it or can it be fixed?

    It possible from reading your post that you may have let the phone battery go into a deep discharge state without knowing it. If that is the case your battery voltage is far to low to reboot your device in a normal manner.
    Try restarting the phone in a safe mode to reduce app use and voltage and current needed. Do this while the original AC charger is connected to your device and plug into the AC outlet, this will help sometimes to give your device an extra voltage kick to restart the normal battery cycle. However if your device has gone to low in the voltage cycle you may need a new li-ion battery installed.

  • None of my apps are working - all say trial and some won't work at all! Why am I paying a monthly fee for this? Service stinks. Somebody needs to respond.

    None of my Creative Cloud apps are working. I have tried all online suggestions with no luck. I have client projects due, and can't complete them without these apps - that I PAY for! I need someone to respond. Is your support really so horrible?

    Link for Download & Install & Setup & Activation problems may help
    -Chat http://www.adobe.com/support/download-install/supportinfo/
    OR
    -Comodo Security kills download http://forums.adobe.com/thread/1460361?tstart=0
    -http://helpx.adobe.com/x-productkb/policy-pricing/activation-network-issues.html
    -http://helpx.adobe.com/creative-cloud/kb/error-downloading-cc-apps.html
    -http://forums.adobe.com/community/download_install_setup
    -http://helpx.adobe.com/creative-cloud/kb/troubleshoot-cc-installation-download.html
    -http://helpx.adobe.com/x-productkb/global/errors-or-unexpected-behavior-websites.html
    -http://helpx.adobe.com/creative-cloud/kb/unknown-server-error-launching-cc.html
    -Server won't connect https://forums.adobe.com/thread/1233088
    -Enable Mac Root User https://forums.adobe.com/thread/1156604

  • I can't get the Google Search App to work.

    My Google Search App was working fine on my iPad mini. Then I installed Chrome and didn't synch it right off the bat. Chrome works fine but now Google Search App won't let me log in or work. I've tried deleting it/reinstalling it and rebooting my iPad mini. What else should I try?

    Shut down and restart the app...
    - From any Home Screen, double tap the home button to bring up the Recents List
    - Tap and hold any icon until they wiggle
    - Press the red (-) to delete the offending app from this list.
    - Press the home button twice when done.
    - Restart the app

  • I recently got my iphone stolen. I am getting an Iphone 3 do all the apps still work properly with this model?

    do all apps work properly even if its an older model?

    Not neccessarily.
    Any app that requires ios 4.3 or later will not work.

  • How do I get my iPad Videos app to work?

    I have the iPad 2. I'm having trouble getting the Videos app that came with the iPad to work. I have several videos on there and when I click on it, it just opens to a black screen. If I swipe from left to right and type in one of the movies on the videos app, it flickers, but won't play. I saw with someone else who had this problem they were told to hit the home button twice, then click on the "minus" sign on the icons of the apps that were open. Well, the iPad 2 doesn't have that. When you hit the button twice, it pulls up all the apps you own/are open at the bottom of the screen to scroll through easily, but none of them have the minus symbol to close them. As far as I know, there is no way to "close" apps on the iPad 2. Any help? If I could delete and reinstall it, that'd be great, but it comes with the iPad so I can't do that.
    Thanks

    What am am I doing wrong then? Because I've done **exactly** those things and the minus sign never appears. Do I have something set up wrong in my settings. If I press and hold one of the apps, they shake and an "x" appears on most of them *except* the apps that came with the iPad (including the "Videos" app). I've also done the tapping the home screen button thing. The icons appear at the bottom of the screen like they're supposed to, and when I press and hold one of the apps, they all start to wiggle, *however* no minus signs appear. Please understand that, "x"s appear on the apps that I have installed, **nothing** appears on the apps that came automatically on the iPad, and no minuses/minus symbols appear on the apps at all. **That** is why I'm having trouble. I can't close and reopen it to see if that will fix it. Is there a setting (under "settings") that I can change so that I *can* open and close the apps (so that a minus sign does appear on the apps)?

  • Iphone 5s Non-build in apps crashing

    I installed few free apps like whatsApp and viber etc on my new iphone 5s and they stoped working and any other non-builtin apps . When I launch them they open for 2 second and back to home screen. I have tried all means like - reinstall the apps. reset the device with hard reset as well. I am not sure what went wrong.

    Hey sidharthwalia,
    Thanks for the question. I understand you are experiencing performance issues with your iPhone 5s and third-party applications. You’ve completed some great troubleshooting so far! To further isolate this issue, it may be necessary to back up and restore your device:
    Choosing an iOS backup method (Should I use iTunes or iCloud to back up my iOS device?)
    http://support.apple.com/kb/HT5262
    iTunes: Restoring iOS software
    http://support.apple.com/kb/HT1414
    Thanks,
    Matt M.

  • How can I get the CC desktop app to work properly?

    Hi,
    I purchased a subscription and now I'm trying to install Adobe CC applications on my computer.
    Unfortunately NOTHING is working the way it should…
    I have tried calling support but they haven't called me back anymore.
    Today I finally managed to get the Creative Cloud Desktop app installed, but it keeps giving me this message:
    "The Creative Cloud installation is no longer functioning, please uninstall and download again from…"
    I think I have tried all suggestions I found; uninstalling the app, repairing disk permissions, shutting down and starting up again, using the cleaner tool, renaming the OOBE folder in my Library… All steps in all order and with a restart and repairing disk permissions in between.
    Also I followed all steps mentioned here: Use the CC Cleaner Tool to solve installation problems | CC, CS3-CS6
    The only thing I can think of that didn't go as described is the verification of the Cleaner Tool, also no log file is created.
    - When you see the message "Adobe Creative Cloud Cleaner Tool completed successfully," click Quit and restart your computer. 
    - In a text editor, such as TextEdit, open /Users/[user name]/Adobe Creative Cloud Cleaner Tool.log.
    I'm not sure what else there could be, is there anyone that has had similar problems and found a way around it?
    All help is appreciated
    By the way, my MacBook Pro 13" Retina is running OSX 10.9.5 on a 2.4 GHz Intel Core i5 with 16 GB or RAM. All CS6 apps have been working without many problems…

    Try to follow below steps
    Click on Finder and then hold Command + Shift + G keys on your keypad
    It will open Go to folder window, type  exactly ~/Library and click on Go
    Then open Application Support > Adobe folders
    Trash AAMUpdater and OOBE folders.
    Now click on finder and hold Command + Shift + G keys on your keypad.
    This time type /Library and click on Go.
    Make sure to remove ~ symbol.
    Then open Application Support > Adobe folders.
    Trash AAMUpdater, Adobe Application manager, OOBE folders.
    Now Click on Finder and then hold Command + Shift + U keys on your keypad.
    It will open utilities folder.
    Trash Adobe Creative Cloud and Adobe Application Manager folders
    Download and Run CC cleaner tool from below link
    http://helpx.adobe.com/creative-suite/kb/cs5-cleaner-tool-installation-problems/_jcr_conte nt/main-pars/accordion_container_1/accordion-par/accordion-item-1/accordion-item-par/proc e dure/proc_par/step_3/step_par/download/file.res/AdobeCreativeCloudCleanerTool.zip
    Accept the license agreement and click on Adobe Application Manager
    Then click on clean up selected
    Close the window
    Download and install Creative Cloud App from below link
    Free Creative Cloud | Download Adobe Creative Cloud free trial

  • How to get GoPro Hero 3+  app to work on iOS6?

    Am unable to get this app to join camera's network.  Anyone else experience this and/or know how to correct it?  TIA.

    Oh yea, I've an ATT iPhone 4S, and I can connect the Hero 3+ Silver to my iPod 3S running iOS 5, but it takes a previous version of the GoPro app.

Maybe you are looking for