It's been rather wet here in the Bay Area (of California), but not as bad as other places. To which I am offering this set of iPhone and iPod touch wallpapers based on the theme Singing In The Rain. Enjoy.
And here is a special bonus set:
http://itunes.apple.com/us/app/animals/id308930648?mt=8 on your clipboard. It's not too bad, but Apple also allows some friendlier URL formats.http://itunes.com/apps/ablepearsoftware/orchardscraps, as well as direct app links like http://itunes.com/apps/orchardscraps. Links to the "artist" page for your company are similar: http://itunes.com/apps/ablepearsoftware.http://itunes.com/apps/animals).



Able Pear is happy to announce that our latest application, Places?, is now available in the iTunes App Store..c and .m code files.MyView.m might contain the global variable doubleTapEnabled:// MyView.m #include <Foundation/Foundation.h> // ... BOOL doubleTapEnabled = YES; // ...To use this variable in
main.m you might do this:// main.m
#include <Foundation/Foundation.h>
BOOL doubleTapEnabled;
int main(void) {
// ...
NSLog(@"doubleTapEnabled = %i", doubleTapEnabled);
// ...
}
This will work the way you expect, but there's a subtle potential gotcha here. Notice that in MyView.m we initialize doubleTapEnabled to YES. When the compiler sees that, it interprets that statement as a global variable definition and allocates space for the doubleTapEnabled variable and sets its initial value. main.m we don't give doubleTapEnabled an initial value, which makes that statement ambiguous: it could be a global variable declaration for doubleTapEnabled or a definition, with doubleTapEnabled initialized to zero (NO).BOOL doubleTapEnabled;can be either a declaration or a definition. At link time, if an unambiguous definition isn't found, the global variable will be created and initialized to zero; if an unambiguous definition is found, that definition will be used to create the global variable.
// ERROR: won't link // MyView.m // ... BOOL doubleTapEnabled = YES; // unambiguous definition // ... // main.m // ... BOOL doubleTapEnabled = YES; // unambiguous definition // ...You will get a linker error like "duplicate symbol _doubleTapEnabled" because you told the compiler to create the same global variable in two different places.
extern keyword comes in. You use extern with global variables to create unambiguous declarations. In addition to helping the compiler, it also clues in anyone reading the code that the global variable is defined (and possibly initialized) elsewhere, but you're simply using it here. So we can rewrite our example like this:// MyView.m // ... BOOL doubleTapEnabled = YES; // unambiguous definition // ... // main.m // ... extern BOOL doubleTapEnabled; // defined in MyView.m // ...And now
doubleTapEnabled is happily unambiguous everywhere.extern to all global variable declarations in your header (.h) files and provide a corresponding definition in a source (.m or .c) file. So the header file MyView.h would look like:// MyView.h // ... extern BOOL doubleTapEnabled; // ...The source file
MyView.m is the same:// MyView.m // ... BOOL doubleTapEnabled = YES; // unambiguous definition // ...And
main.m now looks like:// main.m // ... #include "MyView.h" // ...Next time, we'll look at using the
static keyword to make to make a global variable "private" to a source file.
Able Pear is happy to announce that our latest application, People?, is now available in the iTunes App Store.![]() |
Places? (NEW) Category: Entertainment Released Jan 4, 2009 Version: 1.0 1.3 MB $0.99 USD |
![]() |
People? (NEW) Category: Entertainment Released Dec 28, 2009 Version: 1.0 1.3 MB $0.99 USD |
![]() |
Orchard's Craps (NEW) Category: Games Released Oct 2, 2009 Version: 1.0 2.9 MB $0.99 USD |
![]() |
Hi Ka Flash (NEW) Category: Education Released Aug 15, 2009 Version: 1.0 1.2 MB $0.99 USD |
![]() |
Fridgemags (NEW) Category: Entertainment Released Jul 24, 2009 Version: 1.0 2.3 MB $0.99 USD |
![]() |
Animals? (UPDATED) Category: Entertainment Released Mar 17, 2009 Version: 1.1 1.4 MB $0.99 USD |