iPhone needs a Siri button

Apple’s iPhone desperately needs a Siri button! From the beginning of time (in other words, 2007), the iPhone has only had the Home button. Well, and yes, the Power button. Ok, ok, and the volume buttons! Throughout every iteration these buttons have remained constant. From time to time, the OS added varying functionality to these buttons such as Assistive Touch or Mute/Rotation Lock. But overall their main functionality remained the same. The bottom line is, there is a reason why mechanical buttons are limited in today’s touch era. Mechanical objects offer greater probability of malfunctions than do their digital counterparts. Case in point, the now ubiquitous and quite profitable iPhone… Read More

Continue Reading

Top Ten Mobile App Features

Feedback system Responsiveness Do one thing right Socialize & Gamify A few clicks Website match Analytics Off-line Customize user experience It’s a mobile device Every app needs to provide the user with a direct connection to the company’s customer service department Above all an app must be responsive and quick. The best app in the world is useless if it takes too long to open. Great apps do one thing and do it right! If you try to juggle too much functionality into one app, the user gets overwhelmed. The best way nowadays to keep users interested is to Gamify or Socialize. Gamify means give your users that carrot they… Read More

Continue Reading

GrandCentralDispatch & Blocks

GCD helps improve your apps performance and responsiveness by outsourcing processes that require a lot or computing power to the background while keeping your UI responsive.  Normally you might want to do some heavy lifting. Let’s create an Empty Application.  You need to declare a IBOutlet UIImageView *imageView ivar in your appDelegate, make it a property and synthesize it in .m and make the connection in Interface Builder, IB.  In it’s viewDidLoad method put the following code: // Download the image NSURL *url = [NSURL URLWithString:@”http://www.santiapps.com/assets/bbkoko.jpg”]; NSURLRequest *req = [NSURLRequest requestWithURL:url]; NSURLResponse *res = [[NSURLResponse alloc] init]; NSError *err = nil; NSData *data = nil; data = [NSURLConnection sendSynchronousRequest:req returningResponse:&res… Read More

Continue Reading

iOS App or Cocos2d Game Design – Grand Scheme

A lot of programmers that are entering the iOS application or Cocos2d game arena are somewhat confused about the overall scheme of things. They can’t see the forest for the trees. I’m a very visual learner myself, which actually makes me a rather bad programmer. Actually it makes me a bad programmer because I’m slow to pick stuff up. I need to see the big picture and then dive into the details, not the other way around. So I put together a simple image, for visual learners like myself, to understand how things operate. At this moment its a very simple image. I intend to update it constantly in order… Read More

Continue Reading

TexurePacker 3.0.1 is the best tool for sprite sheets

  Spritesheets are a must these days, what with having to include so much eyecandy now that games for iOS are getting so sophisticated.  Even if not for performance issues, spritesheets are great for simply keeping assets organized in a game.  Add to that the easy to use AutoSD option which makes your HD or Retina Display assets as well as the non-Retina assets easy to manage, TP is by far the best tool for the job. Whether you are a newbie or advanced developer, we highly recommend you pick it up asap.  You’ll see how easy it is to manage your assets and export them.  This is a tool… Read More

Continue Reading

Cocos2d Tips: Creating a Menu

You can create a menu by creating label items or image items and passing them to a CCMenu object. A typical MainMenuScene.m file might look like this: -(void)playScene:(CCMenuItemFont*)itemPassedIn { if ([itemPassedIn tag] == 1) { [[GameManager sharedGameManager] runSceneWithID:kIntroScene]; } else if ([itemPassedIn tag] == 2) { [[GameManager sharedGameManager] runSceneWithID:kSecondScene]; } else if ([itemPassedIn tag] == 3) { [[GameManager sharedGameManager] runSceneWithID:kThirdScene]; } else { CCLOG(@”Unexpected item. Tag was: %d”, [itemPassedIn tag]); } } -(void)displayMainMenu { CGSize screenSize = [CCDirector sharedDirector].winSize; if (sceneSelectMenu != nil) { [sceneSelectMenu removeFromParentAndCleanup:YES]; } // Main Menu CCMenuItemImage *playGameButton = [CCMenuItemImage itemWithNormalImage:@”TapMeToPlay.png” selectedImage:@”TapMeToPlay.png” disabledImage:nil target:self selector:@selector(displaySceneSelection)]; CCMenuItemImage *optionsButton = [CCMenuItemImage itemFromNormalImage:@”someImage.png” selectedImage:@”someImage.png” disabledImage:nil target:self selector:@selector(showOptions)]; mainMenu =… Read More

Continue Reading

Library compile error in XCode 4.5 for iOS6 regarding armv7s and armv7

Here are the resources you will need to fix your libraries.a which are not compiling for armv7s, into working compiling libraries: The post on how to do it: http://www.galloway.me.uk/2012/09/hacking-up-an-armv7s-library/ An article on how to modify your $PATH on your mac: http://www.tech-recipes.com/rx/2621/os_x_change_path_environment_variable/ Another article on how to edit your .profile hidden file: http://www.tech-recipes.com/rx/2618/os_x_easily_edit_hidden_configuration_files_with_textedit/ And this is the lowdown: You will basically have to create the .sh file & .c file mentioned in Matt’s post.  He then explains how to compile the .c and chmod the .sh. Then you must add these files to your path by either creating a .profile or adding this line to your existing .profile: PATH=$PATH:$HOME/afolderwhereyouplacedyourabovefiles # Add to PATH… Read More

Continue Reading

NSOperation

Lets say you are not only downloading tweets (text) from the web, but actual chunks of raw data, such as images. You may have a method that returns a UIImage, such as: -(UIImage*)cachedImageForURL:(NSURL*)url{ //Preferably look for a cached image id cachedObject = [cachedImages objectForKey:url]; if (cachedObject == nil) { //set loading placeholder in our cache dict [cachedImages setObject:LoadingPlacedholder forKey:url]; //Create and queue a new image loading op ImageLoadingOp *operation = [[ImageLoadingOp alloc] initWithImageURL:url target:self action:@selector(didFinishLoadingImageWithResult:)]; [operationQueue addOperation:operation]; [operation release]; } else if(![cachedObject isKindOfClass:[UIImage class]]) { //were already loading the image, dont kick off another request cachedObject = nil; } return cachedObject; } Except notice this time the operation is not… Read More

Continue Reading

No free lunch…

I started coding in iOS since 2009.  I do it part time because I have a full time job, so I dedicate about 3 hours a day, 5 days a week. I am a tech guy, always have been.  Studied Biochemistry and picked up ASP, PHP and moved into iOS.  But because I live in a country where technicians are highly undervalued, I got my MBA in 2000.  So I know a thing or two about how to run a business. So when I started meeting indies in 2009, I approached them and said, “I have some ideas for an app, is anyone interested in working with me?”.  Their response… Read More

Continue Reading

iOS UI Refresh

iOS is undoubtedly a great touch UI. However, it needs a refresh, it’s long overdue for an overhaul.  Not just a “new widget” type refresh but a real overhaul.  If we can make a robot that flies millions of miles to explore a hostile planet… SEARCHING FOR APPS The whole repetitive process of searching for apps in the AppStore, installing them, updating them everyday and switching between them is getting so old, so 2012! We’re are in the era of Robots that travel millions of space miles to do their thing. Robots that park cars, help the elderly etc. Our robots are getting smarter by the day. We need our… Read More

Continue Reading

iOS Indie Developer/Programmer Evolution

These are just random thoughts on what I believe are the pros and cons of coding an app vs a game.  The reason why I am writing this is actually because I find myself in the same predicament.  I’ve been coding crap for the past 3 years and I believe its time to make something “significant”. At first I thought, I’ll code a bunch of apps and even though they might not be Top Pick apps, they will be enough.  Even if they only make about $5-$10 a month,  I may be reaping $100 a month which sounds cool.  I even got into the whole iAds thing and thought it… Read More

Continue Reading

Cocos2d Tips: Animations and image sizing

So you have some art but don’t know how to properly size it for the iPad or iPhone in their 2 versions (retina and non-retina display)! Let’s learn about image sizing and how to use these images in animations for your game objects (player, enemies, power ups or simple eye candy). Before we even get into creating animations, we need to clear up the sizing issue.  Currently there are 4 screen sizes: iPhone NonRetina = 480 x320 iPhone Retina = 960 x 640 iPad NonRetina = 1024 x 768 iPad Retina = 2048 x 1536 This means that when creating art for a game, you will go bonkers sizing images… Read More

Continue Reading

Cocos2d Tips: How to design a game coding strategy

Know you know quite a bit, enough to make a game. Do you know how and where to start? Let’s look at how to start coding your action layer, what code to put in what methods and how to keep your update method clean and tidy. When I started coding, and unfortunately most of my current projects are still coded that way, I simply opened up Xcode and started coding.  iOS apps are a bit better because you can use the “hooks” methods they come with such as viewDidLoad and cellForRowAtIndexPath etc.  Games are a bit more confusing because you are given an empty slate.  At least in Cocos2d you… Read More

Continue Reading

How to Read iOS or Mac OS Programming Documentation

The toughest part for me to get started was reading the Apple Documentation on iOS or MacOS. When I got into more APIs it got more complex. You need to understand how to read API or proprietary code documents in order to understand how to create a piece of code, connect to web services or debug changes in code. You will very often see the term DEPRECATED, which means a particular method name is no longer used. This is very important so let’s take a look at Apple Docs first: This tells us that the object of type NSArray has many methods that you can call on it. They may… Read More

Continue Reading

Passing Data Example

Delegates or Properties, take your pick. PROPERTIES Class A (ViewController) wants to communicate with Class B (ViewController) Before calling Class B, do the following: In Class B, create a @property NSString* receivedValue; In Class A, #import Class B then in the method that calls B (either prepareForSegue or didSelectRowAtIndexPath or some method where you present Class B view controller, do the following: Class B *calledVC = alloc/init calledVC.receivedValue = ‘whatever value you want to pass’; then call Class B VC Done!   DELEGATES Let’s say Class B wants to notify Class A that something has finished.  In Class B add this above your @interface: @protocol YourDelegateProtocol <NSObject> – (void)itemWillBePassed; @end… Read More

Continue Reading

NSCoding & NSUserDefaults to store something simple…

Lets say you created an app which lets you select a person from the Address Book and you wish to set that person as the default user to use each time you launch the app. You want to store that preference in NSUserDefaults. If there is a lot of data to that person, you probably don’t want to store each key, key by key…This is where you can modify your NSObject class to conform to NSCoding and quickly save & load your data. 1. In you NSObject Class add theprotocol. @interface CustomObject : NSObject <NSCoding> 2. Now add these 2 methods to your NSObject Class: – (void) encodeWithCoder:(NSCoder*)encoder; – (id)… Read More

Continue Reading

How to mask a UIImage in iOS

– (void)viewDidLoad { [super viewDidLoad]; UIImage *imageToMask = [UIImage imageNamed:@”koko.jpg”]; UIImageView *imageToMaskImgView = [[UIImageView alloc] initWithImage:imageToMask]; CGRect imgRect = CGRectMake(0, 0, imageToMaskImgView.frame.size.width, imageToMaskImgView.frame.size.height); UIView *maskMaster = [[UIView alloc] initWithFrame:imgRect]; [maskMaster setBackgroundColor:[UIColor whiteColor]]; [maskMaster addSubview:imageToMaskImgView]; UIGraphicsBeginImageContext(maskMaster.bounds.size); [maskMaster.layer renderInContext:UIGraphicsGetCurrentContext()]; UIImage *viewImage = UIGraphicsGetImageFromCurrentImageContext(); UIGraphicsEndImageContext(); NSLog(@”%@ is the view image”, viewImage); UIImage *bFooImg = [UIImage imageNamed:@”blackapple.png”]; self.myPic.image = [self maskImage:bFooImg withMask:viewImage]; } – (UIImage*) maskImage:(UIImage *)image withMask:(UIImage *)maskImage { CGImageRef maskRef = maskImage.CGImage; CGImageRef mask = CGImageMaskCreate(CGImageGetWidth(maskRef), CGImageGetHeight(maskRef), CGImageGetBitsPerComponent(maskRef), CGImageGetBitsPerPixel(maskRef), CGImageGetBytesPerRow(maskRef), CGImageGetDataProvider(maskRef), NULL, false); CGImageRef masked = CGImageCreateWithMask([image CGImage], mask); //memman CGImageRelease(mask); CGImageRelease(maskRef); return [UIImage imageWithCGImage:masked]; }

Continue Reading

Cocos2d Games: PhysicsEditor & TexturePackerPro

Getting an app from idea to finished product is quite a drawn-out process.  As programmers we rarely accept the fact we need help, but thats when tools like these come in.  Tools like PhysicsEditor & TexturePacker are perfect for speeding up the development process of games so that you can focus on the tasks that matter most, the tasks that make a game a winner; game logic. Pick up these tools today, trust me, your expectations will be more than surpassed! http://www.texturepacker.com – The sprite sheet creator turns chaos into order http://www.physicseditor.de – Edit your physics shapes with ease

Continue Reading

Random yet helpful tips for Xcode 4.3.1

I’ve been learning a lot about tools for developing iOS apps and its amazing how much these tools, when you learn how to use them, can help you: Source Control Snippets Edit in Scope Speech Assistant Appirater TestFlight SDK Let’s look at these one by one: Source Control. This tool is for creating “Time Machine” like versions of your project as you progress through your project and make changes to it. The idea is two-fold: (a) Keep important subversions, i.e. version 1.0, 1.0.1, 1.0.5, 1.1.0 etc of your project as you make changes to it. And (b), share those versions with a team of developers so that you all have… Read More

Continue Reading

AppleTV & AirPlay: The future

What can you do with your AppleTV? Aside from streaming movies or buying movies online instead of the limited selection at your local store, you can do much more than watch movies. In it you can access built in apps like YouTube, Netflix, iTunes, WSJ, Flickr, etc. you can play iOS “AirPlay-enabled games” and access the web with apps like these: http://theapple.tv/apps/list-of-airplay-enabled-apps/

Continue Reading

XCode & Git

Ok, i just started getting my feet wet in this but here is the scoop! Git is a versioning technology which allows you to create multiple versions of your project much like TimeMachine on your Mac.  The whole point behind it is that at any time you can go back to a specific project mod and retake it from there. The first step is to GITTIFY your folder.  You can either do this manually from the command line or from Xcode by creating a new project and check marking the Use Git Repository option.  Since you are using Xcode simply check the box for Git in your new project. Now… Read More

Continue Reading

Apple Foxconn Labor

Much was commented this week about Apple’s China factories where American’s favorite phone and tablet computers are made. Being from a developing country myself, I was surprised to see such a big deal made about this “differing” labor practice in such countries when compared to Developed Countries’ practices. First, because when you compare absolute numbers instead of relative (%), statistics can scare or impress anyone. Take the $1.78 hourly wage and the board figure of $17 a month for example: $1.78/hr x 40hrs a week x 4 weeks comes to about = $284.8/mo income. $17 for room for what pretty much looked like my dorm room at University of Tampa,… Read More

Continue Reading

Use a simple NSNotificationCenter alert

The idea behind this is to notify one object/class of another object/class’ action. Thus you need the following: 1. A Class (A) whose object will register to receive notifications (be notified). 2. A Class (B) whose object will be doing something and when it finishes, must notify the other (post notification) Receiving Class A This class must cleanup its listening task so that when it is no longer active, the NSNotificationCenter will not waste time and resources notifying it about events it was once interested in. To do this simply add this to your dealloc method: //1. NSNotifCtr CLEANUP in viewDidUnload or dealloc [[NSNotificationCenter defaultCenter] removeObserver:self]; This class must actually… Read More

Continue Reading

AddressBook UI

Have you ever tried to get data fields from the address book and ran into the wonderful world of ABPerson reference only to find it reads like the blueprints to a space rocket? Here is the straight out code on how to do it: //Commented out code fails because the values are NOT STRINGS, but rather NSCFType) //NSString *fone = (__bridge NSString*)ABRecordCopyValue(person, kABPersonPhoneProperty); //self.telLabel.text = fone; //This on the other hand, does work ABMutableMultiValueRef phoneMulti = ABRecordCopyValue(person, kABPersonPhoneProperty); CFStringRef fone = ABMultiValueCopyValueAtIndex(phoneMulti, 0); NSString *foneObject = (__bridge NSString*)fone; NSLog(@”phone is %@”,foneObject); self.telLabel.text = foneObject; CFRelease(fone); //Haven’t tried with URL //NSString *url = (__bridge NSString*)ABRecordCopyValue(person, kABPersonURLProperty); //self.urlLabel.text = [NSString stringWithFormat:url]; //SocialProfiles… Read More

Continue Reading

Santiapps.com: Digital Graphic Design for newbies (noobs)

Wanted to share this tutorial for graphic design noobs that are interested in creating their own artwork for iOS games. You may indeed have some graphic design skills and some much better programming skills but turning your paper art into digital usable art is a whole new ballgame. Visit this tutorial in spanish, since this is a spanish blog: Diseno Grafico para Juegos Digitales (Principiantes)

Continue Reading

Facebook: Worldwide Genetic Experiment

What does the biggest social network share with the most global science field? Does the most complex web software have anything to do with one of the most complex fields in human nature? Is Facebook the world’s largest human genetic experiment? What do you get when you mount a huge amount of human relational information onto the largest, most accessible data depot in the world?  Ill tell you what you get…the biggest artificial intelligence in the world (since we are not sure about the universe’s size or the possibility of coexisting multiverse’s). Lets think about what Facebook contains.  On a personal level, it contains: Your name, face and personal likes… Read More

Continue Reading