Showing posts with label iOS Dev. Show all posts
Showing posts with label iOS Dev. Show all posts

Thursday, March 5, 2015

Modal Alert for SpriteBuilder

I should add with blocks

This is release 0.1 and it will have several updates including text entry and sliders. Version 0.2 now offers text input along with slider value input. I updated the link to point to v0.2.

For now, grab the sample SpriteBuilder (w/Xcode) project here:

LINK

Quick screenshot:




Please see THIS forum thread for more information.

Saturday, February 14, 2015

Troubleshooting MFMailComposeViewController (iOS 8.1)

Wow, so I spent nearly the entire afternoon wild goose hunting a confirmed(1) problem with
MFMailComposeViewController
seeming to just hang upon presentation; no keyboard pop-up or input but I could cancel/close just fine.

Sorry, here's the fix:
REBOOT THE DEVICE!

What I found most troubling was that all my recent (64bit) updates for my Cocos2D games have a "Contact Developer" button which of course opens a new message pre-filled out and THEY ALL WORKED FINE. From a coding perspective they were all the same so if one worked and others didn't perhaps I would have rebooted the device sooner. Nope, they all worked fine but my non-Cocos2D (UIKit) app was flat-out broken.

ARG

(1)by confirmed I mean I quickly found what sounded like my exact problems on stackoverflow.com and plenty of hits via google.

Tuesday, October 28, 2014

Icon Set Creator v3.0 (iOS 8)


Previous post here: iOS Icon set Creator

So here's what the updated Automator workflow does:
Asks for your base (1024x1024) icon image then duplicates it, scales it and renames it, rinse and repeat until all twelve  (12) icons are created.

Notes: You can use the 1024 size icon to upload to iTunes Connect. Icon names have been revised to match Xcode 6 for easy drag and drop.

File listing:
iPad76@2x.png
iPad76.png
iPad40@2x.png
iPad40.png
iPad29@2x.png
iPad29.png
iPhone40@2x.png

iPhone60@2x.png
iPhone29@2x.png
iPhone60@3x.png
iPhone40@3x.png
iPhone29@3x.png


The workflow WILL NOT overwrite any existing files so make sure to put your base image in its own folder.

1000 words..... (very, very old screenshots...)

Test folder with 1024 icon (can be named whatever you want)

Launch Automator app and click the Run button...
Browse to and select your 1024 icon file
This is where the "magic" happens (lol!)

Completed folder with shiny new icons, yeah!
(Very old image)

In the zip file is a second Automator "application" named "Create iOS Iconset Droplet iOS8". You don't run this application you simply drop your 1024 icon onto it and the magic happens... sweet right? I know... :-]

To use the droplet, just drag the droplet to your Dock. Now when you need a set of icons, place your master image in a folder, then drag it on top of the droplet and give it about 3 seconds and its done. This has a permanent home in my Dock.


Download link: CLICK ME

Friday, September 12, 2014

Xcode 6, Simulator & iOS 8

Um yeah so what's up with the "features" in Xcode 6?

1: The "new" Devices window only show about 10-12 lines of the device log - um yeah, thanks Apple, that's helpful! NOT.



2: Being familiar with shortcut key combos; we all know that {CMD} + {SHIFT} + {K} will Klean the build (see what I did there) but now in the simulator there's the SAME combination that will DISABLE the on-screen keyboard. So, make sure your have Xcode selected before you press that key combo! Yeah I futzed around debugging that non-existing problem for about 30 minutes! ARG

 



3: UIActionSheet has now gone the way of UIAlertView; meaning you can no longer sub-class it and add subviews. Handy, right? Well github to the rescue; just drop this bad boy in and off you go!
LINK

Well that's it for now, back to cleaning up my apps for iOS 8!


Monday, October 14, 2013

GKSession didChangeState delegate not working in iOS 7

So the GKSession transfer code that has been working ever since iOS 4.0 decided to STOP working (1/2 way) under iOS 7. Yeah, right? what else is new? :-p

The specific error or problem was that the connect code to display the alert where the user drags a slider for the desired number of vouchers to transfer, was not showing on iOS 7 device.

The iOS 7 devices DID receive vouchers so that meant the GKSession WAS valid.

So, in debugging it I found that even though the delegate was set, the didConnectPeer callback was firing but the didChangeState: WAS NOT.

So.... an easy-peasy kludge of a patch now allows iOS 7 devices to transfer vouchers to their iOS 6 (and iOS 5) brethren.

- (void)peerPickerController:(GKPeerPickerController *)picker didConnectPeer:(NSString *)thePeerID toSession:(GKSession *)theSession 
{    
self.session = theSession;
self.session.delegate = self
    self.peerID = thePeerID; 
    
    [self.session setDataReceiveHandler:self withContext:NULL];
    [picker dismiss];
    picker.delegate = nil;
    
    float sysVersion = [[[UIDevice currentDevice] systemVersion] floatValue];
    if (sysVersion > 6.9) {
       if (!didConnect)
           [self session:self.session peer:self.peerID didChangeState:GKPeerStateConnected];
    }
}

 Full disclosure: I also added a boolean flag so that the GKPeerStateConnected "state" will only fire once, regardless of "where" it came from.

        case GKPeerStateConnected:
            if (!didConnect) {
                didConnect = TRUE;
                NSLog(@"Peer %@ Connected", self.peerID);
                [self performSelector:@selector(promptForQty) withObject:self afterDelay:1.0];
                self.statusLabel.text = @"Connected";
                [self.launchShareButton setTitle:@"Stop" forState:UIControlStateNormal];
                [self.launchShareButton setTitle:@"Stop" forState:UIControlStateHighlighted];
                [self.connectingActivityIndicatorView stopAnimating];
            }
            break;

Friday, September 13, 2013

Icon set Creator v2.0 (iOS7)


Previous post here: iOS Icon set Creator

So here's what the updated Automator workflow does:
Asks for your base (512x512 OR 1024x1024) icon image then duplicates it, scales it and renames it, rinse and repeat until all thirteen (13) icons are created.

Notes: If you use 1024 size you can (and should) use that icon to upload to iTunes Connect.


Icon-120.png = 120x120
Icon-144.png = 144x144
Icon-152.png = 152x152
Icon-72.png = 72x72
Icon-76.png = 76x76
Icon-Med-40.png =40x40
Icon-Med-40@2x.png = 80x80
Icon-Small-50.png = 50x50
Icon-Small-50@2x.png = 100x100
Icon-Small.png = 29x29
Icon-Small@2x.png = 58x58
Icon.png = 57x57
Icon@2x.png = 114x114


The workflow WILL NOT overwrite any existing files so make sure to put your base image in its own folder.

1000 words.....

Test folder with 1024 icon (can be named whatever you want)

Launch Automator app and click the Run button...
Browse to and select your 512 icon file
This is where the "magic" happens (lol!)

Completed folder with shiny new icons, yeah!
(Very old image)

In the zip file is a second Automator "application" named "Create iOS Iconset Droplet iOS7". You don't run this application you simply drop your 1024 icon onto it and the magic happens... sweet right? I know... :-]

To use the droplet, just drag the droplet to your Dock. Now when you need a set of icons, place your master image in a folder, then drag it on top of the droplet and give it about 3 seconds and its done. This has a permanent home in my Dock.

Updated: 14-09-2013 - removed the "[ ]" in the name - this caused a problem for some on the droplet. No need to re-download, simply rename and remove the brackets. Thanks @Dragyn at cocos2d forums!

Download link: CLICK ME

Friday, August 16, 2013

Replacement AlertView and ActionSheet

Give that iOS 7 has totally hosed any hope for custom AlertViews I hacked up a couple of nice options available on github.

Here's the finished product in a sample project.

DISCLAIMER: THIS SUITS MY NEEDS, if it doesn't suit your needs, sorry, look elsewhere...


LICENSE: matches the github MIT EXCEPT for Alex1987 - go use your fancy frackin' TSAlertView, 'mm-kay! ;)

DOWNLOAD LINK

:-)

Example of what you do by subclassing this:


This was accomplished just like how you'd do it pre-iOS 7 (code snip it below)

- (id)initWithTitle:(NSString *)title yoffset:(int)yoffset minValue:(int)minValue setValue:(int)setValue maxValue:(int)maxValue message:(NSString *)message delegate:(id)delegate cancelButtonTitle:(NSString *)cancelButtonTitle okButtonTitle:(NSString *)okButtonTitle image:(NSString*)imageName {

self = [super init];
if (!(self = [self initWithTitle:title message:message delegate:delegate cancelButtonTitle:cancelButtonTitle otherButtonTitles:okButtonTitle, nil])) return nil;
    CGFloat xCenter = kTTMaxContentFrameWidth * 0.5f;
    
    self.mySlider = [[UISlider alloc] initWithFrame:CGRectMake(xCenter-110, kSliderOffsetForY, 220, (kIsAniPad ? 48.0 : 36.0))];
    self.mySlider.minimumValue = (float)minValue;
    self.mySlider.maximumValue = (float)maxValue;
    self.mySlider.tag = 0;
    if (yoffset == -1) {
        self.mySlider.value = 0;
    }
    else {
        self.mySlider.value = (float)setValue;
    }
    
    self.mySlider.continuous = YES;
    [self.mySlider addTarget:self action:@selector(sliderAction:) forControlEvents:UIControlEventValueChanged];
    
    // Setup custom slider images
    UIImage *minImage = [UIImage imageNamed:@"leftSide.png"];
    UIImage *maxImage = [UIImage imageNamed:@"rightSide.png"];
    UIImage *thumbImage = [UIImage imageNamed:@"thumb.png"];
    UIImage *thumbPressedImage = [UIImage imageNamed:@"thumbpressed.png"];
    
    minImage=[minImage stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0];
    maxImage=[maxImage stretchableImageWithLeftCapWidth:10.0 topCapHeight:0.0];
    
    // Setup the sliders
    [self.mySlider setMinimumTrackImage:minImage forState:UIControlStateNormal];
    [self.mySlider setMaximumTrackImage:maxImage forState:UIControlStateNormal];
    [self.mySlider setThumbImage:thumbImage forState:UIControlStateNormal];
    [self.mySlider setThumbImage:thumbPressedImage forState:UIControlStateHighlighted];
    [self.containerView addSubview: self.mySlider];

    if (minValue == maxValue) {
        self.mySlider.hidden = TRUE;
}
    
self.myLabel = [[UILabel alloc] initWithFrame:CGRectMake(xCenter-120, kLabelOffsetForY, 240, 22)]; //20
self.myLabel.backgroundColor = [UIColor clearColor];
self.myLabel.textColor = [UIColor blueColor];
self.myLabel.font = kTTAlertSliderFont;
self.myLabel.textAlignment = UITextAlignmentCenter;
self.myLabel.text = [NSString stringWithFormat:@"Selected Amount: %i", (int)self.mySlider.value];

if (yoffset == 23) {
self.myLabel.text = [NSString stringWithFormat:@"Selected Amount: %i", (int)self.mySlider.value];
}
else {
self.myLabel.text = [NSString stringWithFormat:@"Selected Amount: %i", setValue];
}
[self.containerView addSubview:self.myLabel];
NSString *imagePath = [[[NSBundle mainBundle] resourcePath] stringByAppendingPathComponent:[NSString stringWithFormat:@"Alert/%@", imageName]];
    CGRect iframe = CGRectMake(8.0, 12.0+yoffset, 156.0, 60.0);
    if (kIsAniPad)
        iframe = CGRectMake(12.0, 14.0+yoffset, 312.0, 120.0);
    
self.myImageView = [[UIImageView alloc] initWithFrame:iframe];
self.myImageView.image = [UIImage imageWithContentsOfFile:imagePath];
    
[self.containerView addSubview:self.myImageView];    
    
return self;
}

- (void)alertView:(TTAlertView *)alertView didDismissWithButtonIndex:(NSInteger)buttonIndex {
pressedButton = buttonIndex;
}

Sunday, February 26, 2012

iPad3 Retina Assests

So... iPad3, with retina display (2048x1536).

Have you prepped any assests for this yet? I'm thinking it may lead to the death of universal apps. maybe..

In WARP gce I of course have retina images (iPhone/iPod) and they add about 12-13MB's to the overall app size. I just did a quick check in preparing iPad retina images and I'll be lucky to squeeze them into another 22MB!

That makes my 45MB app grow to nearly 70MB!
!WOW!

Tuesday, July 26, 2011

Install Xcode 3 on Lion

I'm not going to post anything but this link:

http://anatomicwax.tumblr.com/post/8064949186/installing-xcode-3-2-6-on-lion-redux

:-)

I needed this because I still use Property List Editor to edit and save binary plist and strings files. If anyone knows how to do this with Xcode 4, please let me know.

NOTICE: I tried to open my .strings file AFTER I opened and saved it in Xcode 4 and it was corrupt! YIKES!, fortunately I made a copy before and was able to open that file. So initially there is a problem with binary plists (a strings file is just a plist) inside Xcode 4.1 on Lion. The Xcode 3 Property List Editor can read / write plain (text) plists and binary format.

Thanks

Monday, July 25, 2011

10.7 and iOS Production Environment

Well over the weekend I made the switch to 10.7 Lion. I performed a clean install, mostly because my 10.6 had more crap installed than I care to admit. About the only thing I may miss is MacPorts / ImageMagik.

I checked several blogs and noticed the trend was posting how to make Lion like 10.6 SL.... ????

Yeah, guess we're a bit afraid of change, aren't we.. ?

So far I'm all set after just a couple of days; YES I can scroll backwards, er I mean natural scrolling ;-)

Just one thing that is going to give me Carpal Tunnel and that is with my MagicPad I used to be able to tap-tap and drag to select text or drag an item in Finder. Yeah, that's gone, so now about all I can do as a replacement is to enable three-finger drag... um yeah I'm not sure how long before that feels natural... I look like someone with, oops sorry, need to be politcally correct. We'll leave it at it sure feels awkward.

My iMac is now one revision old, a 3.06GHz 21.5" model and it wails with 10.7 installed but I'm a firm believer in clean installs. :-)

So I've been mostly working today and I'm nearly used to the new scrolling method and am in the process of build and testing with Xcode v4.1 (love the new analyzer!). I hope to submit YAU (yet another update) after v1.2.2 gets approved (WARP gce) so I'll post any problems. Just remember to deselect the System Tools on your Beta Xcode installs and you should be golden. Oh yeah... made a trip to Terminal to "mkdir /Beta" since the Xcode installer wouldn't let me create a new root folder, eh?

Friday, July 22, 2011

Know Success Even When it Slaps You in the Face!

AKA: Hyper WARP gce Development Report

Hyper WARP gce was developed because:
1: I love Space Trading games
2: I needed to get a handle on a full Game Center integration
3. I needed to get a handle on adding consumable IAP's in an app

While I did not write this down, (which I think all your goals should be written down) I loosely defined success for the project as 500 Game Center players within 30-days. Yeah I realize Tiny Tower has, what, 1.2 million! I like to keep my goals attainable and realistic! ;-) I also looked at a bunch of other indie Game Center games and was surprised by the low number of players.

Sorry, I digress. I kept track each day the number of Game Center players and we broke the 500 mark 20 days in and after 31 days we had 701 players. Now these weren't all active players, but they did play and report scores. For completeness it is day 34 and we have 742 total Game Center players (4200+ total downloads).

Just think if I had spent more than $0.00 on marketing... ;-)

 - SUCCESS! -

In addition, we now have a "tiny", in relative App Store numbers, group of core players, that even while the current version of the app crashes, in multiple areas (yeah, epic failure on my part!), they LOVE PLAYING IT. They have also provided GREAT FEEDBACK (thanks guys and girls!)

Note: Some of the crashes only come after playing the game for like 90 minutes (to clarify that's 90 minutes without a pause!) <- pretty sure that's another type of success!

Take Aways:
1. Game Center support is an absolute MUST HAVE for your game
2. If YOU don't LOVE playing your game, why would anyone else?
3. Leverage the work done and shared by others (don't reinvent the button!)
4. If you give something away if you app crashes, plan on it crashing ;-)
5. Quick turn around (start then finish in a few turns) games are very popular. It was 5-days before submission before we added the 3 Jump Challenge (most popular, of course it's first game mode), prior the shortest game play was 5 Jumps.
6. You can have a successful app while NOT supporting older devices (um yeah, if your device doesn't multi-task, sorry, no WARP gce for you).

In the Credits we list all the shared code used but I'd be remiss in not thanking TWO projects that were critical in the development of WARP gce.
1. ASTStoreKit : by Anystone Technologies
2. GameKitHelper: by Steffen Itterheim

Don't be afraid to push the envelope; Hyper WARP gce has what I believe are some app store "firsts":
* In App Consumables can be transferred to any other iOS device (buy a 10-pack then send 5 to another device)
* An Achievements leaderboard. With 40 achievements we wanted to hook as many "types" of players and this way you can compete at the achievement level and see how well other players are doing.
* First "good" Space trader game in Game Center ;-)

WAIT - you don't know what Hyper WARP gce is? So you haven't played it yet? Come on, it's FREE, give it a try. App Store Link.

Monday, July 11, 2011

CrashCatcher

Available on GitHub:
http://github.com/meachware/CrashCatcher

Ever wish you could apologize to your user after your app crashed? Me too.

Please note this is designed for MULTI-TASKING DEVICES ONLY!

Enter CrashCatcher, no it does nothing to prevent or "catch" crashes or errors in your app; I'll leave that up to you. What it does is simply logs that the app started up and logs that the app did resign properly.

When it doesn't resign properly, well that's a crash.

Check it out on GitHub, includes working demo.

Sunday, July 10, 2011

Come on guys!

[Rant]
For the love of god! Fellow developers:
1: if you support rotation in you app, for christs sake, rotate it and test it!
2: if you use networks services, test your app on cellular AND an EDGE connection! <- especially if you are trying to show me your wares!
3: if you offer a universal app, make sure it functions properly on a real iPad!
[End of rant]

Okay, I know I feel better, how about you?
:-/

Saturday, July 9, 2011

Show Developer Notices

So while we are deep in the forest, putting out fires, inspecting the underbrush... sometimes... I know just every so often, um, we forget to "undo" our developer hacks / changes.

I now call this method from applicationDidBecomeActive ... to help :-)

In a common header file I have:

#define kAllowCheats                    1   // 1 on, 0 off

In my game manager I have this:
-(void)checkDevSettings
{
    // Developer notices
    if (getenv("NSZombieEnabled") || getenv("NSAutoreleaseFreedObjectCheckEnabled")) {
        NSLog(@"NSZombieEnabled/NSAutoreleaseFreedObjectCheckEnabled enabled!");
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Developer Notice"
                                                        message:@"NSZombieEnabled is ON!\n* * *\nDisable BEFORE submitting!"
                                                       delegate:nil 
                                              cancelButtonTitle:@"Okay" 
                                              otherButtonTitles:nil];
        [alert show];
        [alert release];
    }
    if (kAllowCheats) {
        UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Developer Notice"
                                                        message:@"kAllowCheats is ON!\n* * *\nDisable BEFORE submitting!"
                                                       delegate:nil 
                                              cancelButtonTitle:@"Okay" 
                                              otherButtonTitles:nil];
        [alert show];
        [alert release];
    }
}


This first one I almost submitted an app, the second one; yup went live with my developer / cheat codes active. That wasn't a game center game so it wasn't a real problem but with all the hacking in Game Center games I suppose it could cause you extra work.

Sunday, June 12, 2011

[iOS5] Caution!

I had Xcode 4.0.2 installed in /Developer and Xcode 4.2 (beta) installed in /Beta. I could work and run both just fine.

I had to submit an update to an existing app (WARP gce was approved!). When I built to test the app on my device Xcode 4.0.2 gave me a signing error, something about the code_wrapper. So I tried just re-installing Xcode 4.0.2 and the error was fixed (most likely because Xcode 4.0.2 wrote-over whatever tools the beta installed). I did not try and run the beta, as I was still focused on getting the update submitted. So, archived and then submitted to the store and Xcode reported a confirmation but a few minutes later the App Store rejected the binary. Here is the verbiage:
Invalid Signature - Make sure you have signed your application with a distribution certificate, not an ad hoc certificate or a development certificate. Verify that the code signing settings in Xcode are correct at the target level (which override any values at the project level). Additionally, make sure the bundle you are uploading was built using a Release target in Xcode, not a Simulator target. If you are certain your code signing settings are correct, choose "Clean All" in Xcode, delete the "build" directory in the Finder, and rebuild your release target.

In addition if you thought you'd like to try and check out iCloud and updated your profiles, you cannot submit to the store. Remove the enable for iCloud setting and update your profiles to fix. Here is the error I got back for that error:
Invalid Code Signing Entitlements - Your application bundle's signature contains ubiquity code signing entitlements that are not supported.
Specifically, value "( xxxxxxxxxx.* )" for key "com.apple.developer.ubiquity-container-identifiers" in is not supported.

So in summary: you can run both copies of Xcode on your Mac but if you need to submit to the store you may need to remove the beta and reinstall 4.0.2.

If I find anything more about this I will update this post. There are a few discussions on the Dev forums I'm watching and participating in.
:-)

Saturday, April 23, 2011

MeachWare Intern Positions

We have two intern positions available. Please see this post and stay tuned for the job posting ads.

Update: Added both job descriptions.


Links to PDF's here:

Thanks
Greg