Default image not showing up for iPhone app
So if you don't see your Default.png image showing up, try these steps:
1) First, make sure your "Default.png" is named exactly that ("default.png" will not work).
2) Second, make sure Default.png is in the root directory of your project.
3) Do a clean of your target.
4) Then build and your default image should show up.
I also noticed that running this in the simulator was not helpful because my app started very quickly and the default image only displayed for a second. So, make sure you give this a try on the device to see how long the default image really displays.
Good luck!
iPhone / Objective-C Code Examples (and .NET equivalents)
1) Use NSLog liberally to debug as you write your code. You can really do a lot with it. A few standard statements are for printing strings or numbers, and you can also print an Objective-C object. Here are the three I use most often:
NSLog(@"%@", aString); // prints any NSString, for example
NSLog(@"%d", anInt); // prints a signed int
NSLog(@"%f", aFloat); // prints a float
2) If you have a UITableView that you need to have updated, you can reload it with this command (assuming it is named "tableView"):
[self.tableView reloadData];
3) Need to iterate through a collection? Try this handy code snippet, which is similar to For Each in .NET languages:
for (id currentObject in allObjects) {
// do something here with currentObject
}
4) Here is how you can check to see if an object is certain type. This is a bit like using gettype or typeof in .NET to find a specific type:
if ([myObject isKindOfClass:[TheClassIAmLookingFor class]]) {
}
5) Here is how you cast an object in Objective-C, like using CType or DirectCast in .NET:
TypeToCastTo typeCastObject = (TypeToCastTo *)myObject;
6) I show alert pop-ups a lot in my apps. Here is a simple example for an alert launched when a button is clicked, and responded to to perform some action.
-(void)resetClicked:(id)sender withEvent: (UIEvent *) event {
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Reset" message:@"Are you sure you want to reset this puzzle?\nAll of your work will be lost!" delegate:self cancelButtonTitle:@"Cancel" otherButtonTitles:@"OK", nil];
[alert show];
[alert release];
}
- (void)alertView:(UIAlertView *)actionSheet clickedButtonAtIndex:(NSInteger)buttonIndex {
// the user clicked the OK button
if (buttonIndex == 1)
{
// reset logic goes here
}
}
7) Split is a great function in .NET. Here is the Objective-C equivalent:
NSArray *arrayOfValues = [commaDelimitedListOfValues componentsSeparatedByString:@","];
More code snippets next time! Good luck!
Update your AdWhirl SDK to 1.2.7 (and Include the AddressBook Framework)
There is one caveat--when I replaced my 1.2.5 SDK with the 1.2.7 SDK, I started getting all kinds of compiler errors. I sent a note to AdWhirl support (which responded really quickly--thanks!) and they said you need to include the AddressBook framework into your app because it is by AdMob. I did not see this anywhere in the documentation, and of course, I did not expect it simply going from 1.2.5 to the more recent version. It is a 10 second fix, but I wanted everyone to be aware.
Good luck!
My Favorite iPhone Development Books
Beginning iPhone 3 Development: Exploring the iPhone SDKAre you a programmer looking for a new challenge? Does the thought of building your very own iPhone app make your heart race and your pulse quicken? If so, Beginning iPhone 3 Development: Exploring the iPhone SDK is just the book for you. Updated and revised for iPhone SDK 3, many of the discussions in the original book have been clarified to make some of the more complex topics easier to understand. In addition, all of the projects have been rebuilt from scratch using the SDK 3 templates. | |
Programming in Objective-C 2.0 (2nd Edition)From the author of Programming in C, Programming in Objective-C 2.0 provides the new programmer a complete, step-by-step introduction to the Objective-C language. The book does not assume previous experience with either C or object-oriented programming languages, and it includes many detailed, practical examples of how to put Objective-C to use in your everyday programming needs. | |
iPhone SDK 3 Programming: Advanced Mobile Development for Apple iPhone and iPod touch (Wiley)Apples iPhone is the hottest mobile device on the planet. More than one million iPhone 3G phones were sold in the first three days of release and millions more are sure to be in the hands of iPhone fans each year. Apples iPhone SDK has been updated and includes more than one thousand new APIs that developers will want to get their hands on. | |
How To Make An iPhone AppDo you want to start developing iPhone apps, but find the technology confusing? Here is the ALL-IN-ONE iPhone development resource that will give you everything to need to make an iPhone App! | |
iPhone App Secrets - Making Money With iPhone AppsThe mobile phone application market has exploded recently. Never before in history has it been so easy for you to tap into a ready made army of cash rich customers! Right now, there are around 20 million iPhone owners. These iPhone owners spend upwards of $50 million dollars every single month on new iPhone applications. |
iPhone Blogs That I Follow
iPhone Developer/Development Blogs | Travis Dunn - Imagine my surprise when the internet failed to produce a select list of iPhone development blogs more than 10 links wide. Well, I've beaten the internet at its own game and collected the links myself, like a neurotic SERP.
A More In Depth Look At The How To Make An iPhone App Book - ... where you should have no trouble figuring out how to use those libraries on your own. You can get more information on the How To Make An iPhone App homepage by clicking here. ©2009 iPhone Development Tutorials and Programming Tips. ...
creating a calander - iPhone Dev SDK Forum - I want to create a calendar. which is can be scrolled vertically and contains dates of the next seven weeks. I am new to iphone development therefore.
iPhone Game Development With Core Animation | iPhone Development ... - I've made quite a few posts about OpenGL ES, and the available game engines on the iPhone, and I'd like to iterate that you do not need to use OpenGL ES or.
FurdLog » Messing With Developer Infrastructure Conventions - By creating games and other programs for the iPhone, software developers hoped to find millions of new customers. But they didn't expect to feel muzzled. The software development kit that Apple Inc. distributed to programmers bound them ...
WordPress for iPhone + Source Code Available! < A Fool's Wisdom - Earlier this week my Automattic colleagues and Effigent released WordPress for iPhone and iPod Touch. Now, the source is also available and Trac is set up for reporting bugs and participating in development! ...
The iPhone App Store is Pure Genius - Apple's iPhone App Store allows third-parties to release software for the iPhone (built with an API provided by Apple) to all iPhone users. They can charge what they want for the app, and delivery and payment is managed beautifully within the iPhone interface through your iTunes account. By providing the medium (iPhone) and the delivery service (App Store), Apple has created a completely self-sustaining business model that generates passive income for them and increases demand for the product with each awesome release on the App Store.
Top 15 iPhone Web Development Resources - Here is a list of links to the best available iPhone development resources such as simulators, development plugins, wikis, and other JavaScript/HTML/Safari documentation. iPhoney – A free iPhone web simulator for designers. ...
How Much Is Too Much For An iPhone App? » Webomatica ... - Just tossing this out there, since I have come down with a case of iPhone app price sensitivity.