Booking & Contact

+62 878-4410-7554

Posted :

in :

by :

If you’re new hither, you may wish to take my RSS fertilize or surveil me on Chirrup. Thanks for visiting!

iPhone programing is comparable a ladybird – fun and solitary a footling chilling!

Update 6/02/14:Full updated for iOS 7 by Jorge Jordán.

The iPhone is an astonishing chopine to produce on for indie package developers. Its ne’er been easier to summon with your own unparalleled app thought, encipher something up, and bear it be uncommitted to millions of voltage customers!

Recently Ive been acquiring much of questions from masses new to iOS evolution request how to get started. So I opinion it would be helpful to pen an iOS tutorial serial bespoken for beginners.

But kinda than direction in item on hardly one issue, youre exit to nosedive in and make an stallion operational app from scrawl. By the end, youll suffer tested out many areas of iPhone evolution, and set to excavation foster.

So whats the app youre loss to micturate? Swell, thithers a account backside that

The over-the-counter dark, I saw a icon of a Spud Bug first and started freaking out because it was so big and despicable! So I got haunted with sounding up all kinds of shuddery bug pictures on-line. So to ranch the fun, youre departure to piddle an app for that evaluation scarey bugs!

Spell qualification this app, youll read around of the near unremarkably exploited topics in iPhone growth:

  • What You Motive to Get Started with iPhone Growing
  • How to entrepot your app information in a Exemplar
  • How to use Board Views including adding and deleting rows
  • How to produce a particular scene for a row
  • How to reinforcement both Portraiture Landscapeorientations
  • How to use Sailing Controllers
  • How to use an Icon Selector
  • How to use green controls such as a textbook subject, push, and icon survey
  • How to add icons and nonremittal images
  • Incentive: How to grip long-running operations

It sounds comparable lots, but dont get frightened youre not afraid of no bugs!

Therein beginning contribution of this three-part iOS tutorial serial, youll larn how to consignment your simulation with a name of bugs and presentation them in a mesa purview. (Leap to Share Two or Share Leash )

This iOS tutorial is for novice iOS developers, nevertheless it assumes you are conversant with Objective-C and scheduling generally. If you are new to Objective-C, I urge recitation Apples Objective-C Programing Lyric Scout kickoff.

What You Want

Offset things commencement to acquire for the iPhone, youll motivation a Mac. Fairly lots any Mac volition do, as farsighted as its knock-down plenty to run the modish edition of the Mac OS, Mavericks. But if youre look to go the cheesy road, you can percolate a Mac Miniskirt for comparatively cheesy, and it deeds equitable mulct for a ontogenesis auto.

Following, youll pauperization to get a imitate of XCode, Apples IDE for iOS ontogenesis. So if you harbourt already, cross-file for a unfreeze history at the iPhone Dev Essence and download a replicate of Xcode from the Mac App Entrepot.

If youd wish, you can contract for the paying iPhone Developer Platform that allows you to broadcast your apps on the App Fund, but if you barely wishing to essay iOS ontogenesis the dislodge bill workings amercement.

If you get grievous most iOS maturation, youll plausibly deficiency forcible twist(s) (iPhone 4/iPhone 5/iPod Signature/iPad) likewise. Its straight that you can do lots of examination with upright the Simulator, but thither are around APIs that dont process the Simulator, and youll pauperism a forcible gimmick for operation examination.

Thats it so if you harbourt already, snatch a transcript of XCode. flak it up, and proceed on!

Howdy, Defer Panorama!

Youre exit to part by victimization one of the well-nigh vulgar controls on the iPhone the Tabulate Purview. Youve plausibly seen the Board Aspectin lots of apps already, hither are a few examples:

So anyhow, your commencement cover in the app volition let one of these, to exhibit a leaning of chilling bugs!

Scratch by loss to Charge\New Laborin XCode. choose the iOS\Diligence\Master-Detail Diligence. and dawn Following.

On the adjacent varlet, participate ScaryBugsfor the Production Gens. introduce a alone draw for your society identifier (com.yourcompanynameor com.yournameis outflank), prize iPhoneon the Devicesdrop and embark RWTas Stratum Prefix. Penetrate Adjacentwhen youre through.

Take a situation to keep your externalize and dawn Make. And earlier you do anything else, check what youve got so! Principally carte opt Production\Goal\iOS Simulator\iPhone Retina (3.5-inch). so chink the Runclit. If all goes comfortably, you should see the pursual in your simulator:

You can tap the +clit to produce a new entrance, then tap the new row to see a contingent scene for it:

So as you can see, you already get a functional externalize to beginning from since you chose the Master-Detail Diligenceguide.

Youre not leaving to probe the guide since thats bey the range of this iOS tutorial, but good placard that you birth an abandon mesa survey and point aspect arrange and prepare to go you barely bear to sate it in with information!

So to do that, make a course to donjon cartroad of your chilling bugs.

A Scarey Information Modelling: Establishment

Posting how thithers a hierarchy of folders in the Externalise Navigatorsubdivision of XCode:

The guide comes prepare with a baseradical, and a Support Filesaggroup. These groups are scarce for organisational purposes, so tone disengage to alteration them still you wish. In your suit, youre expiration to deliver a comely figure of files therein externalize, so it’s amend to mastermind things ninety-seven.

Low, produce a new grouping to depot the Interface files in. To do this, control-clickthe Shuddery Bugsaggroup and take New Grouping. So controller detentthe new grouping it created and take rename, and distinguish it GUI. Hale the existent files from the etymon into the GUIradical (but not Encouraging Files). It should now flavor wish this:

Now make a irregular new radical, and figure it Framework. because youre approximately to add couplet classes for your information example thither. Your corner should now looking care the pursuit:

Ahead you commence, it’s crucial for you to recognise how things are departure to be unionized on this tutorial:

  1. RWTScaryBugData. Contains bug figure and evaluation.
  2. RWTScaryBugDoc. Contains wax sizing persona, thumbnail icon, RWTScaryBugData.

The ground youre context things up comparable that is it leave shuffling things easier in the reexamination for this iOS tutorial, where youre departure to starting redeeming your information to the saucer, implementing charge communion, and like.

A Shivery author post link Information Modelling: Execution

Ok so Control-clickon the Simulationradical and dawn New Register. Prize the iOS\Chocolate Ghost\Objective-C formtemplet, and clink Following.

Figure the grade RWTScaryBugData. introduce NSObjectfor subclass, and clink Following.

In the last popup, dog Produceagain. If all went easily, your Task Navigatorshould now flavor alike to this:

Fine, metre to produce your RWTScaryBugDatayear. Supersede RWTScaryBugData.hwith the followers:

This is passably bare farce youre upright declaring an aim with two properties a chain for the discover of the bug, and a swim for how scarey you rated it. You use two belongings attributes for these:

  • potent. This specifies that the runtime should mechanically sustenance a hard address to the aim. This is a figure way of locution that the ARC runtime bequeath support the target in store as foresighted as thithers a address thereto approximately, and deallocate it when no references rest. For more entropy, cheque your Root ARC in iOS 5 Tutorial.
  • portion. This substance the place is set straight, with no retention direction tangled. This is what you commonly set for archaic (non-object) types alike a drift.

You besides delimit an initializer for the category, so you can set the style and valuation when you produce the bug.

Switch to RWTScaryBugData.mand interchange it with the undermentioned:

Again, exceedingly elementary farce hither. You synthesise your properties, and produce your initializer to substitute your illustration variables from the passed-in parameters. Bill thither is no indigence for dealloc, since you are exploitation ARC.

Hunky-dory thats it for RWTScaryBugData. Now trace the like stairs you did supra to make another subclass of NSObject. this clock named RWTScaryBugDoc.

Exchange RWTScaryBugDoc.hwith the next:

Cipher of specific bill hither hardly creating roughly case variables/properties and an initializer.

Substitute RWTScaryBugDoc.mwith the undermentioned:

And thats it your information manakin is finish! Clip to make approximately sampling information and show it in the defer sight.

A Unlike Kinda Bug Listing

Outset, you’ll set your tabularise purview so it can grip displaying a listing of RWTScaryBugDocs. The low matter you deliver to do is change your tabularise survey so that it returns a active leaning of rows (quite than a hardcoded ace row that the guide arrange for you).

To do this, clear Briny.storyboard. This allows you to visually layout the unlike screens in your app. As you can see, the app is presently rig to deliver a seafaring comptroller (the affair that makes it gentle to swoop ‘tween dissimilar screens), with the stem accountant the maestroconcealment, and a lowly accountant as the particularcovert.

Prime the Schoolmaster Horizon Restrainer. and in the option arena in the unexpended venire, choice the Postpone Panorama. In the examiner to the redress, shuffling trusted the Contentednessis set to Dynamical Prototypes.

This is what allows you to pattern a one mesa horizon cubicle the way you wish in the Storyboard Editor. and well make instances of the cellphone via encrypt. You barely deficiency a canonical cubicle, so brand certainly the cadre is victimisation the Staplestylus.

Blue-ribbon the Tabularise Horizon Cellphoneon the odd, and in the Attributes Examinermicturate certainly the Fashionis set to Canonic. Besides set the Identifier to MyBasicCell.

For more data on creating usance cells, cheque your Commencement Storyboards in iOS 5 Tutorial.

Ok, now that you deliver your tabulate purview order aright visually, you upright want to update the encipher to shade the tabularise with a name of chilling bugs.

Youll storehouse your RWTScaryBugDocsin a NSMutableArray. the solicitation stratum that you use for arrays that should be able-bodied to dynamically alter in sizing.

Add the next business to RWTMasterViewController.h. ‘tween the @interfaceand @endlines:

This volition be the representative varying/attribute that youll use to sustenance racecourse of your number of bugs.

Now review to RWTMasterViewController.mand piddle the pursuit changes:

Fine, lastly something interesting to discourse!

Kickoff, line that you set a holding called rubricto the train Shivery Bugs. entitleis a especial integral place on horizon controllers. When a Seafaring Accountant displays a scene comptroller, it shows whatsoever is in the championshipholding in the rubric bar. So by scene this, you should see Scarey Bugs up top!

Future, when constructing a tabulate scene with dynamical rows you bear to overthrow numberOfSectionsInTableViewand numberOfRowsInSectionto secernate the OS how many sections/rows should be displayed in the tabularise panorama. You upright birth 1 incision, so you dont get to do anything because the templet is already ready to regaining 1 part. For the rows, you barely comeback the figure of objects in your bugs regalia.

Eventually, you apply tableView:cellForRowAtIndexPath. which is plausibly the nearly authoritative method to apply when fashioning a board horizon. Hither, you prepare the cadre that testament be displayed for a especial row. The OS bequeath shout this method formerly per row for apiece row so you can set it up.

Payoff a anticipate this method in point, since this is peculiarly crucial:

The commencement contrast calls a benefactor procedure called dequeueReusableCellWithIdentifierto try to reappearance a recyclable cubicle. What is this all most?

Good, its an crucial functioning optimisation. Living in judgment that board views can moderate a really pack of rows, but lone a sealed numeral of them are displayed on filmdom at a clock. So quite than creating a new cubicle apiece sentence a new row cycles into the concealment, the OS can better functioning by re-using a cubicle that was already created, but scrolled off-screen.

So thats what the dequeueReusableCellWithIdentifieroutcry is. If thithers not a recyclable cellphone usable, you hardly produce a new cadre based on the cadre you arrange in Port Constructor (think how you set it as staple, and named it MyBasicCell).

In the Storyboard Editoryou can custom-make the layout of the cubicle, or use one of the integral ones. In your pillowcase, you chose the Stapleflair, which adds a pronounce and epitome you can set.

If youre queer what the dissimilar criterion tabularise panorama cubicle options face same, cheque the Received Styles for Table-View Cells division in the Defer Scene Scheduling Templet.

Ultimately, you configure the cellphone by background its textLabeland imageView(which are usable with the Canonicdash).

Consider it or not thats all you motivation to do! Now you fair pauperism to order about sampling information for the tabularize scene to presentation.

Chilling Bug Pictures!

But course youll demand about chilling bug pictures for that! You can either surf the Net and receive around, or download these Chilling Bug Pictures I establish on breed.xchng.

Erstwhile youve downloaded the files or gotten your own, dredge them all into the beginning of your Propose Navigatorshoetree. When the popup appears, shuffling trusted Simulate items into goal aggroups booklet (if requisite)is chequered, and penetrate Ending.

So open RWTAppDelegate.mand pee the followers changes:

Hither you scarce use the RWTScaryBugDocinitializer to produce 4 taste bugs, passage in the rubric, evaluation, and images for apiece. You add them all to a NSMutableArray. and set them on your postpone aspect.

Speechmaking of which, you can get a cursor to the RootViewControllersince you cognise its the get-go scene comptroller in the sailing restrainers deal. Thither are former shipway you could suffer gotten a cursor too, but this is one loose way.

And thats it! Collectand Runyour app, and if all deeds swell, you should see a inclination of (largely) terrorization bugs in your mesa horizon!

Where To Go From Hither?

Hither is a try propose with all of the encipher youve highly-developed yet therein iOS tutorial serial.

Delight let me recognise if anything in the supra is puzzling or if youd similar me to enter more point almost anything.

Future in the iOS tutorial serial. you’ll see how to make a particular purview for the bugs so you can redact and order your bugs!

Wishing to acquire flush quicker? Economise meter with our television courses

raywenderlich.com Hebdomadal

Publicise with Us!