So like most people who are on the ball, I downloaded the Xcode beta with the iPad SDK. Obviously this is what you should do right away if you're an iPhone developer because you should probably get at least vaguely familiar with the iPad and you might even want to port your software to it before the hardware is available.
That's all good, but it looks like there is at least one serious bug in the thing involving nib file loading. I had an application that kept crashing every time it tried to load a nib file. Normally this happens because some connection is pointing to a property that no longer exists or something, but in this case the thing was crashing even loading a brand new empty nib file, or a brand new nib file with one unchanged object.
I switched back to the release version of Xcode (3.2.1) and everything worked.
So it shouldn't come as a surprise, but there are still some serious issues with 3.2.2 that go beyond what I would expect even a beta to suffer from. I'd avoid using 3.2.2 for anything at all save for iPad tinkering.
Intercepting touch events before they reach controls
Thursday, January 14, 2010
Thought maybe I should mention this here since it seems to be necessary and very useful in certain situations:
http://stackoverflow.com/questions/2003201/observing-pinch-multi-touch-gestures-in-a-uitableview/2003781#2003781
http://stackoverflow.com/questions/2003201/observing-pinch-multi-touch-gestures-in-a-uitableview/2003781#2003781
Target Template for Building iPhone IPA Files
Saturday, January 9, 2010
I created a Xcode Target Template that makes it easy as pie to add an IPA target to your xcode project. Download it here!
If you're not familiar with IPA files, see this previous post on the subject. (The template file basically just encapsulates what's described in that post, but in a template file to make things easier.)
Instructions:
If you're not familiar with IPA files, see this previous post on the subject. (The template file basically just encapsulates what's described in that post, but in a template file to make things easier.)
Instructions:
- Just add the 'IPA File Target.trgttmpl' template file to either of these directories:
- "~/Library/Application Support/Developer/Shared/Xcode/Target Templates/Cocoa Touch"
- "/Library/Application Support/Developer/Shared/Xcode/Target Templates/Cocoa Touch"
- In Xcode, right click on the Targets folder in your project or otherwise select the Add Target menu item from somewhere. Look under User Templates on the left, click Cocoa Touch, and there the template will be. Select it and add.
- Once you add the target you should edit it and add your Application target as a Direct Dependency. (That way the application will automatically get built first if you try to build the IPA target and the application isn't built yet.)
- To actually build the IPA file, change your Active Build Target from MyAppName to MyAppName.IPA in the Project->Set Active Target menu and build. (Of course you need to make sure you already have iPhone Device as the active SDK and your Release configuration set up with the proper code signing profile for an ad-hoc distribution since an IPA file with a debug build for the simulator isn't going to be too useful.)
Hiding an UIToolbar with ease-out animation
Friday, January 1, 2010
Here's a little code snippet that someone might find useful for people who want to allow users to hide a toolbar so the full screen can be used to view other content:
If you also use setStatusBarHidden:animated: then it seems that the only effect you can get is the alpha fade in and out, so using that somehow on the status bar helps the animations match. You can't change the frame of the status bar.
In case you aren't aware, it's worth noting that setting alpha to 0 will not only visually hide a view but it will also no longer receive events which would appear to make it equivalent to using hidden = YES. Using toolbar.hidden doesn't seem to work with Core Animation.
There are more elaborate examples on this guy's blog.
static BOOL toolbarHidden = NO;
// toolbar
[UIView beginAnimations:@"toolbar" context:nil];
if (toolbarHidden) {
toolbar.frame = CGRectOffset(toolbar.frame, 0, -toolbar.frame.size.height);
toolbar.alpha = 1;
toolbarHidden = NO;
} else {
toolbar.frame = CGRectOffset(toolbar.frame, 0, +toolbar.frame.size.height);
toolbar.alpha = 0;
toolbarHidden = YES;
}
[UIView commitAnimations];
Obviously the static variable only makes sense if you only have one toolbar. It would be more proper to put that in the class. You could also just use the alpha to determine if it's hidden if you're using that anyway, but I've been playing with different effects and have that commented out half the time. // toolbar
[UIView beginAnimations:@"toolbar" context:nil];
if (toolbarHidden) {
toolbar.frame = CGRectOffset(toolbar.frame, 0, -toolbar.frame.size.height);
toolbar.alpha = 1;
toolbarHidden = NO;
} else {
toolbar.frame = CGRectOffset(toolbar.frame, 0, +toolbar.frame.size.height);
toolbar.alpha = 0;
toolbarHidden = YES;
}
[UIView commitAnimations];
If you also use setStatusBarHidden:animated: then it seems that the only effect you can get is the alpha fade in and out, so using that somehow on the status bar helps the animations match. You can't change the frame of the status bar.
In case you aren't aware, it's worth noting that setting alpha to 0 will not only visually hide a view but it will also no longer receive events which would appear to make it equivalent to using hidden = YES. Using toolbar.hidden doesn't seem to work with Core Animation.
There are more elaborate examples on this guy's blog.
Subscribe to:
Posts (Atom)