Loading presentation...

Present Remotely

Send the link below via email or IM

Copy

Present to your audience

Start remote presentation

  • Invited audience members will follow you as you navigate and present
  • People invited to a presentation do not need a Prezi account
  • This link expires 10 minutes after you close the presentation
  • A maximum of 30 users can follow your presentation
  • Learn more about this feature in our knowledge base article

Do you really want to delete this prezi?

Neither you, nor the coeditors you shared it with will be able to recover it again.

DeleteCancel

Make your likes visible on Facebook?

Connect your Facebook account to Prezi and let your likes appear on your timeline.
You can change this under Settings & Account at any time.

No, thanks

Very Simple iOS development

No description
by

joe aphiboon

on 14 December 2012

Comments (0)

Please log in to add your comment.

Report abuse

Transcript of Very Simple iOS development

very SIMPLE iOS development how coding interface design idea provisioning profile code signing usability ios developer program objective-c cocos2d APP STORE ebooks, website,
youtube, etc. developer.apple.com published to xcode flash platform unity3d stage3d s that ? basic logical
thinking syntax/semantic C objective method Model View Contoller cocos2d Framework memory management getters / setters communication data user interface our code delegate read / write delegate protocol [sender messages] method model / view / controller ourprogramname.h ourprogramname.m header / declaration implementation ourprogramname.xib storyboard user interface Core Concept collection of objects instruments outlet connect from controller properties to view action target should, will, did keep in sync between controller and view delegate data at, count data source Object-Oriented classes mylibrary myBookList book bookName authorName bookDescription object's properties object's properties methods methods -getBookTitle -setBookTitle actions performed on objects mylibrary.h book.h book.m Objectivec for Absolute Beginner bookName : Objectivec for Absolute Beginner bookdescription : yyyyyyyyyyyyy author : Gary Bennett Learning Cocos2d bookName : Learning Cocos2d bookdescription : xxxxxxxxxxxx author: Rod Strougo instants - bookCount MasterViewController detailViewController DetailViewController currentBook -getBookDescription . . we create instance variables then we create methods to access those variables properties are not required for all instance variables theList bookNameLabel authorNameLabel bookdescriptionTextView mylibrary.m model controller view UML Unified Modeling Language MasterViewController.h MasterViewController.m MyBookLibrary App a list of methods declarations,
unattached to class definition helper #import <Foundation/Foundation.h>

@interface Book : NSObject

@property (nonatomic,strong)NSString *bookName;
@property (nonatomic,strong)NSString *authorName;
@property (nonatomic,strong)NSString *bookDescription;
@property (nonatomic,strong)NSString *filename;


@end #import "Book.h"

@implementation Book

@synthesize bookName,authorName,bookDescription,filename;

@end #import <Foundation/Foundation.h>


@interface myLibrary : NSObject

@property (nonatomic,strong) NSMutableArray *myBookList;

@end #import "myLibrary.h"

#import "Book.h"

@implementation myLibrary

@synthesize myBookList;

-(id) init{

self=[super init];

if(self) {

self.myBookList=[[NSMutableArray alloc]init];
Book *newBook = [[Book alloc]init];
newBook.bookName=@"Objectivec for Absolute Beginner";
newBook.bookDescription=@"This is the first step recommended book for the beginner";
newBook.authorName=@"Gary Bennett";
newBook.filename=@"01Objectivec for Absolute Beginner.PNG";
[self.myBookList addObject:newBook];

newBook=[[Book alloc]init];
newBook.bookName=@"Learning Cocos2d";
newBook.bookDescription=@"Using Cocos2d framework to create game in iOS";
newBook.authorName=@"Rod Strougo";
newBook.filename=@"02Learning Cocos2d.PNG";
[self.myBookList addObject:newBook];

newBook=[[Book alloc]init];
newBook.bookName=@"iPhone and iPad app for Absolute Beginner";
newBook.bookDescription=@"Learning iPhone and iPad Development for the beginner";
newBook.authorName=@"Dr. Rory Lewis";
newBook.filename=@"03iPhone and iPadapp for Absolute Beginner.PNG";
[self.myBookList addObject:newBook];

newBook=[[Book alloc]init];
newBook.bookName=@"HeadFirst iPhone and iPad Development";
newBook.bookDescription=@"Teaching iphone and iPad Development using images and diagrams, very easy to understand";
newBook.authorName=@"Dan Pilone";
newBook.filename=@"04HeadFirst iPhone and iPad Development.PNG";
[self.myBookList addObject:newBook];

newBook=[[Book alloc]init];
newBook.bookName=@"iPad iOS5";
newBook.bookDescription=@"Very Good e-book from iBook store. This book explains everything about iOS 5 development and also all new features";
newBook.authorName=@"Neil Smyth";
newBook.filename=@"05iPad iOS5.PNG";
[self.myBookList addObject:newBook];

newBook=[[Book alloc]init];
newBook.bookName=@"iOS Programming";
newBook.bookDescription=@"Another recommended book for iOS Development starter point";
newBook.authorName=@"Joe Conway";
newBook.filename=@"06iOS Programming.PNG";
[self.myBookList addObject:newBook];

[myBookList release];
[newBook release];
}
return self;

@end #import <UIKit/UIKit.h>

@class myLibrary;


@interface MyLibAppMainViewController : UITableViewController

@property(nonatomic,strong) NSMutableArray *theList;

@end #import "MyLibAppMainViewController.h"

#import "Book.h"
#import "myLibrary.h"
#import "MyLibAppDetailViewControllerViewController.h"

@interface MyLibAppMainViewController ()

@end

@implementation MyLibAppMainViewController

@synthesize theList;


-(void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {

if ([segue.identifier isEqualToString:@"showBook"]){

MyLibAppDetailViewControllerViewController *dvc =[segue destinationViewController];
NSIndexPath *path=[self.tableView indexPathForSelectedRow];
Book *c = [theList objectAtIndex:[path row]];
[dvc setCurrentBook:c];
}

}

- (id)initWithStyle:(UITableViewStyle)style
{
self = [super initWithStyle:style];
if (self) {
// Custom initialization

}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];

myLibrary *nBook=[[myLibrary alloc]init];
self.theList=[[NSMutableArray alloc]initWithArray:nBook.myBookList];

[nBook release];
[theList release];


// Uncomment the following line to preserve selection between presentations.
// self.clearsSelectionOnViewWillAppear = NO;

// Uncomment the following line to display an Edit button in the navigation bar for this view controller.
// self.navigationItem.rightBarButtonItem = self.editButtonItem;
}

- (void)viewDidUnload
{
[super viewDidUnload];
// Release any retained subviews of the main view.
// e.g. self.myOutlet = nil;
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{

// Return the number of sections.
return 1;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{

// Return the number of rows in the section.
return [self.theList count];

}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"BookCell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];

if(cell==nil){
cell=[[UITableViewCell alloc]initWithStyle:UITableViewCellStyleDefault
reuseIdentifier:CellIdentifier];
}

// Configure the cell...
Book *current =[theList objectAtIndex:indexPath.row];
cell.textLabel.text= [current bookName];


return cell;
}

/*
// Override to support conditional editing of the table view.
- (BOOL)tableView:(UITableView *)tableView canEditRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the specified item to be editable.
return YES;
}
*/

/*
// Override to support editing the table view.
- (void)tableView:(UITableView *)tableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath
{
if (editingStyle == UITableViewCellEditingStyleDelete) {
// Delete the row from the data source
[tableView deleteRowsAtIndexPaths:[NSArray arrayWithObject:indexPath] withRowAnimation:UITableViewRowAnimationFade];
}
else if (editingStyle == UITableViewCellEditingStyleInsert) {
// Create a new instance of the appropriate class, insert it into the array, and add a new row to the table view
}
}
*/

/*
// Override to support rearranging the table view.
- (void)tableView:(UITableView *)tableView moveRowAtIndexPath:(NSIndexPath *)fromIndexPath toIndexPath:(NSIndexPath *)toIndexPath
{
}
*/

/*
// Override to support conditional rearranging of the table view.
- (BOOL)tableView:(UITableView *)tableView canMoveRowAtIndexPath:(NSIndexPath *)indexPath
{
// Return NO if you do not want the item to be re-orderable.
return YES;
}
*/

#pragma mark - Table view delegate

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
// Navigation logic may go here. Create and push another view controller.
/*
<#DetailViewController#> *detailViewController = [[<#DetailViewController#> alloc] initWithNibName:@"<#Nib name#>" bundle:nil];
// ...
// Pass the selected object to the new view controller.
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
*/
}

@end #import <UIKit/UIKit.h>

#import "Book.h"
#import "myLibrary.h"
#import "MyLibAppImageShowViewController.h"


@interface MyLibAppDetailViewControllerViewController : UIViewController


@property (nonatomic,strong) Book *currentBook;
@property (retain, nonatomic) IBOutlet UILabel *bookNameLabel;
@property (retain, nonatomic) IBOutlet UILabel *authorNameLabel;
@property (retain, nonatomic) IBOutlet UITextView *bookdescriptionTextView;

@end #import "MyLibAppDetailViewControllerViewController.h"

@interface MyLibAppDetailViewControllerViewController ()

@end

@implementation MyLibAppDetailViewControllerViewController

@synthesize currentBook;
@synthesize bookNameLabel;
@synthesize authorNameLabel;
@synthesize bookdescriptionTextView;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];
self.bookNameLabel.text=currentBook.bookName;
self.authorNameLabel.text=currentBook.authorName;
self.bookdescriptionTextView.text=currentBook.bookDescription;


// Do any additional setup after loading the view.
}

-(void) prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
MyLibAppImageShowViewController *isv =[segue destinationViewController];
[isv setCurrentBook:[self currentBook]];

}

- (void)viewDidUnload
{
[self setBookNameLabel:nil];
[self setAuthorNameLabel:nil];
[self setBookdescriptionTextView:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (void)dealloc {
[bookNameLabel release];
[authorNameLabel release];
[bookdescriptionTextView release];
[super dealloc];
}
@end #import <UIKit/UIKit.h>
#import "Book.h"
#import "myLibrary.h"


@interface MyLibAppImageShowViewController : UIViewController

@property (nonatomic,strong) Book *currentBook;
@property (retain, nonatomic) IBOutlet UIImageView *currentImage;
- (IBAction)backButton:(id)sender;

@end #import "MyLibAppImageShowViewController.h"

@interface MyLibAppImageShowViewController ()

@end

@implementation MyLibAppImageShowViewController

@synthesize currentBook;
@synthesize currentImage;

- (id)initWithNibName:(NSString *)nibNameOrNil bundle:(NSBundle *)nibBundleOrNil
{
self = [super initWithNibName:nibNameOrNil bundle:nibBundleOrNil];
if (self) {
// Custom initialization
}
return self;
}

- (void)viewDidLoad
{
[super viewDidLoad];

UIImage *image =[UIImage imageNamed:[currentBook filename]];
[self.currentImage setImage:image];

// Do any additional setup after loading the view.
}

- (void)viewDidUnload
{
[self setCurrentImage:nil];
[super viewDidUnload];
// Release any retained subviews of the main view.
}

- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
return (interfaceOrientation == UIInterfaceOrientationPortrait);
}

- (void)dealloc {
[currentImage release];
[super dealloc];
}
- (IBAction)backButton:(id)sender {

[self dismissModalViewControllerAnimated:YES];
}
@end sender.messages DetailViewController.h DetailViewController.m
Full transcript