[This is an old post that I've brought over from the old vinnycoyne.com blog. I've updated the download links to point to the repo over on GitHub]
I'm currently testing & debugging an iOS app, which is logging quite a bit of location-related data using NSLog()
. This is fine when I'm tethered to my MacBook Pro, but it's not so great for testing in the field.
So, rather that lugging around the MBP, I decided to make use of the various iOS devices I have lying around and turn them into a console for NSLog()
data. It's pretty basic right now (and not exactly production-ready), but it works well.
I should also note that the portion of code which overrides NSLog()
came from c99koder's lastfm-iphone source code.
Add BTLog to your own app:
Download the BTLog project files here and add BTLog.h
and BTLog.m
to your app's Xcode project.
Add GameKit.framework
to your Xcode project.
In main.m
, add: #include "BTLog.h"
Note that that's include
and not import
!
In your app delegate's header file: #import "BTLog.h"
and in your declarations (in the same file): BTLog *btLogger;
In your app delegate's implementation (.m
) file:
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
btLogger = [[BTLog alloc] initWithDelegate:self];
// ...
}
(you can put this anywhere, but I find it handiest here.)
Note that the delegate is set to self
— we're doing this so that the following method gets called — put it anywhere in your app delegate's .m
file:
-(void)logStringToRemoteDevice:(NSString *)string {
if (string.length > 0 && btLogger) {
[btLogger logString:string];
}
}
Connect the two apps over Bluetooth and you should see your NSLog()
strings appear in the BTLog app.
If you spot any bugs or have any suggestions for improvement, drop me a line.
Feel free to use this in any app that you're developing, but don't forget to remove the code once you begin building for production!
I recently gave a talk titled "7 App Store Tips" at the Dublin Web Summit.
One of the tips I discussed was the use of an in-app alert, which reminds users to rate/review your app on the App Store.
I've since tidied up my code a little and uploaded the class for re-use within your own apps.
Usage:
VCReviewPopup* popup = [VCReviewPopup sharedPopup];
popup.appStoreURL = [NSURL URLWithString:@"https://itunes.apple.com/ie/app/eirtext/id286099297?mt=8"];
popup.numberOfDaysBeforeShowingPopup = 14; // Show alert after two weeks
[popup showAlertReminderAfterDaysHaveElapsed];
Seeing as the new Apple TV has just been released and is winging its way to lucky TV addicts around the globe, it's only a matter of time before this question crops up again.
The Apple TV is a lovely device, but content selection outside of the USA stinks. In some cases, it's non-existent. So, let's show you how to set up an account, which will let you get the most entertainment out of your new toy…
I tweeted a while back that I was working on some scripts which would help automate the process of batch-importing .avi video files in iTunes for use on my Apple TV. Some folks asked how they could set it up for themselves.
At the time, I was using a couple of Automator scripts, which were triggered by folder actions. They worked, but not very well, so I never posted them online.
Since then, however, I've found a much simpler way of converting & importing using an Elgato Turbo.264 HD dongle and a copy of VideoDrive.