Drawing stuff directly in ios gets a bit slow as soon as you have more than a few images onscreen. So we should use a library like:
Cocos 2d tutorial
Cocos 2d with Box2d tutorial
For the more hard core there is Open GL
For full cross platform 3D goodness at a minimum $400 price tag (plus you'd need a copy of Maya) there is the rather awesome looking: Unity
Andy's IPhone Objective C notes
Thursday, 12 January 2012
Tuesday, 3 January 2012
Controllers
How to replace the current controller with a new one. In this case GameController
For a navigatable version with back functionality:
GameController *c = [[GameController alloc] initWithNibName:@"GameController" bundle:nil];
[self presentModalViewController:c animated:YES];
[c release];
For a navigatable version with back functionality:
[self.navigationController pushViewController:c animated:YES];
Friday, 4 November 2011
App Store submission
Unlike the Android Market the Apple App Store submission is a pain in the backside. Here are my notes from repeatedly failing at it:
Setup your app details in Itunes Connect. Your bundle ID should look something like this: com.nuclearcarrot.oystererrors
Next manage your certificates and profiles at apple developer
Go to Provisioning. Create a Distribution Profile (Note a Developer Profile). Can not use a Wildcard AppId for this.
Your appid should look like this: 1234123456.com.nuclearcarrot.oystererrors
Download this baby and drag it into XCode.
Xcode Project -> Build Settings -> Code Signing and configure it as Iphone Distribution.
Setup your app details in Itunes Connect. Your bundle ID should look something like this: com.nuclearcarrot.oystererrors
Next manage your certificates and profiles at apple developer
Go to Provisioning. Create a Distribution Profile (Note a Developer Profile). Can not use a Wildcard AppId for this.
Your appid should look like this: 1234123456.com.nuclearcarrot.oystererrors
Download this baby and drag it into XCode.
Xcode Project -> Build Settings -> Code Signing and configure it as Iphone Distribution.
Sunday, 23 October 2011
Monday, 18 July 2011
Check if Running on Simulator
How to add an if to check if you are running on the simulator:
Source
#if TARGET_IPHONE_SIMULATOR
NSLog(@"APPIRATER NOTE: not supported on the iOS simulator.");
#else
// Do Live stuff
#endif
Source
Labels:
simulator
Sunday, 5 June 2011
Core Data schema change migration
Place the below in your:
To remove the old data store (clear out old data models):
To migrate data using Lightweight Migration
In Xcode 4 we migrate data models by:
select data model. (on left)
Apple - alt - 1 ( View - Utilities - File Inspector)
Versioned Data model (on right side of utilities window)
- (NSPersistentStoreCoordinator *)persistentStoreCoordinator
method
To remove the old data store (clear out old data models):
[[NSFileManager defaultManager] removeItemAtURL:storeURL error:nil];
To migrate data using Lightweight Migration
[NSDictionary dictionaryWithObjectsAndKeys:[NSNumber numberWithBool:YES],NSMigratePersistentStoresAutomaticallyOption, [NSNumber numberWithBool:YES], NSInferMappingModelAutomaticallyOption, nil];
In Xcode 4 we migrate data models by:
select data model. (on left)
Apple - alt - 1 ( View - Utilities - File Inspector)
Versioned Data model (on right side of utilities window)
Wednesday, 11 May 2011
Camera + Action Sheets Basics
Header should implement:
and then we paste these methods into the main file:
@interface CapturedPhotoController : UIViewController <UINavigationControllerDelegate, UIImagePickerControllerDelegate, UIActionSheetDelegate> {
and then we paste these methods into the main file:
- (IBAction) takePictureButton: (id) sender {
NSLog(@"snap");
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypeCamera]) {
NSLog(@"is camera ok");
UIActionSheet *photoSourceSheet = [[UIActionSheet alloc] initWithTitle:@"Select fugitive picture"
delegate:self
cancelButtonTitle:@"cancel"
destructiveButtonTitle:nil
otherButtonTitles:@"Take new photo", @"Choose existing photo", nil, nil];
[photoSourceSheet showInView:self.view];
[photoSourceSheet release];
}
else {
NSLog(@"No camera");
UIImagePickerController* picker = [[UIImagePickerController alloc] init];
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
picker.delegate = self;
picker.allowsEditing = YES;
[self presentModalViewController:picker animated:YES];
}
}
-(void) actionSheet:(UIActionSheet *) actionShet didDismissWithButtonIndex:(NSInteger)buttonIndex {
UIImagePickerController *picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsEditing = YES;
switch(buttonIndex) {
case 0:
NSLog(@"user wants to take new picture");
picker.sourceType = UIImagePickerControllerSourceTypeCamera;
picker.delegate = self;
picker.allowsEditing= YES;
break;
case 1:
NSLog(@"user wants to choose existing picture");
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
break;
default:
[picker release];
return;
}
[self presentModalViewController:picker animated:YES];
}
-(void) imagePickerController:(UIImagePickerController *) picker
didFinishPickingImage:(UIImage*) image
editingInfo:(NSDictionary*) editingInfo {
self.fugitive.image = UIImagePNGRepresentation(image);
[self dismissModalViewControllerAnimated:YES];
[picker release];
}
Labels:
camera
Subscribe to:
Posts (Atom)