Professional Documents
Culture Documents
A Simplified Approach to Developing Apps for the Apple iPhone and iPad
Chapter 5
Functions
A Guide to this Instructor’s Manual:
We have designed this Instructor’s Manual to supplement and enhance your teaching
experience through classroom activities and a cohesive chapter summary.
Overview
© 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for
classroom use.
Objective-C and iOS Programming:
A Simplified Approach to Developing Apps for the Apple iPhone and iPad
Chapter 5 introduces different parts of functions with examples. It also discusses the
prototype declaration, return types, the scope of variables, and passing parameters.
Chapter Objectives
• Declare, create, and call functions
• Distinguish between the scope of variables
• declared inside and out functions
• Declare prototypes
• Pass parameters to functions
Lecture Notes
• Functions and methods are used in most programming languages to refer to a set
of instructions that are executed for a specific task. Methods in Java are the same
thing as functions in Objective-C.
• When the statements are grouped outside a class, they are called a function. When
they are inside a class, they are called a method.
• Prototyping is helpful to understand and is used in a different context in the
second part of the book that covers iOS. It is a good idea for the students to
understand prototyping.
• Prototyping is done to inform the compiler of the presence of a function so the
compiler knows to expect the return type.
• Just as in Java, Objective-C has formal and informal parameters.
© 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for
classroom use.
Objective-C and iOS Programming:
A Simplified Approach to Developing Apps for the Apple iPhone and iPad
Short Quiz:
Q1: What is a function?
Answer: It is a group of lines of code that are specific to a task.
Q9: What do you call a parameter if the parameter is listed in the actual function?
Answer: Actual parameters.
© 2015 Cengage Learning. All Rights Reserved. May not be copied, scanned, or duplicated, in whole or in part, except for use as
permitted in a license distributed with a certain product or service or otherwise on a password-protected website for
classroom use.
Another document from Scribd.com that is
random and unrelated content:
E. W. Brooks,
The Emperor Zenon and the Isaurians
(English Historical Review, April, 1893).
ISCA.
T. Mommsen,
History of Rome,
book 8, chapter 5.
ISHMAELIANS, The.
See MAHOMETAN CONQUEST: A. D. 908-1171;
also, ASSASSINS;
and CARMATHIANS.
ISINÆ.
See CAUSENNÆ.
ISLAM.
J. W. H. Stobart,
Islam and its Founder,
chapter 10.
E. Gibbon,
Decline and Fall of the Roman Empire,
chapter 50.
ALSO IN:
E. Sell,
The Faith of Islam.
S. Lane-Poole,
Studies in a Mosque,
chapters 3 and 7.
R. D. Osborn,
Islam under the Arabs,
part 2, chapter 1.
W. C. Taylor,
History of Mohammedanism,
chapters 5-13.
R. Bosworth Smith,
Mohammed and Mohammedanism
T. Nöldeke,
Sketches from Eastern History,
chapter 3.
See, also,
MAHOMETAN CONQUEST.
{1804}
See DAR-UL-ISLAM.
ISLE OF FRANCE.
The old French province containing Paris. Also the French name
of Mauritius island, taken by England in 1810.
ISLE ROYALE.
See CAPE BRETON: A. D. 1720-1745.
ISMAILEANS, OR ISHMAELIANS.
ISONOMY.
ISOTIMY.
ISAGORIA.
G. F. Schömann,
Antiquity of Greece: The State,
part 2, chapter 12.
ISOPOLITY.
B. G. Niebuhr,
Lectures on the History of Rome,
lecture 13 (volume 1).
ISRAEL.
See JEWS.
ISTAKR, OR STAKR.
G. Rawlinson,
Seventh Great Oriental Monarchy,
chapter 3, footnote.
ISTER, The.
ISTHMIAN GAMES.
See NEMEAN.
----------ISTRIA: Start--------
ISTRIA:
Slavonic Occupation of.
ISTRIA: A. D. 1797.
Acquisition by Austria.
----------ISTRIA: End--------
ISTRIANS, The.
See ILLYRIANS.
ISURIUM.
T. Wright,
Celt, Roman and Saxon,
chapter 5.
ITALI, The.
See ŒNOTRIANS.
ITALIOTES.
See SICELIOTEB.
----------ITALY: Start--------
ITALY:
Ancient.
Early Italians.
"It was not till the close of the Republic, or rather the
beginning of the Empire, that the name of Italy was employed,
as we now employ it, to designate the whole Peninsula, from
the Alps to the Straits of Messina.
H. G. Liddell,
History of Rome,
introduction, section. 2.
T. Mommsen,
History of Rome,
book 1, chapters 2-3.
See, also,
ETRUSCANS; LATIUM; SABINES; SAMNITES;
UMBRIANS; MAGNA GRÆCIA;
also, ROME: B. C. 343-290, and 339-338.
Academy,
March 31, 1894, page 273.
ITALY:
Under the dominion of Rome.
See ROME.
ITALY:
Invasions Repelled by Rome.
ITALY: A. D. 400-410.
Alaric's invasions.
ITALY: A. D. 452.
Attila's invasion.
The origin of Venice.
ITALY: A. D. 476-553.
The fall of the Western Roman Empire.
The Ostrogothic kingdom of Theodoric, and its fall.
Recovery of Italy by Justinian.
ITALY: A. D. 539-553.
Frank invasions.
ITALY: A. D. 554-800.
Rule of the Exarchs of Ravenna.
ITALY: A. D. 568-800.
Lombard conquests and kingdom.
Rise of the Papal power at Rome.
Alliance of the Papacy with the sovereigns of the Franks.
Revival of the Roman Empire under Charlemagne.
J. Bryce,
The Holy Roman Empire,
chapter 4.
R. W. Church,
The Beginning of the Middle Ages,
chapter 7.
ITALY: A. D. 685-1014.
The founding of the duchy of Tuscany.
ITALY: A. D. 781.
Erected into a separate kingdom by Charlemagne.
E. Gibbon,
Decline and Fall of the Roman Empire,
chapter 56.
ITALY: A. D. 803-810.
Charlemagne's boundary treaties with the Byzantine Emperor.
Attempts of Pipin against the Venetians.
The founding of Modern Venice.
ITALY: A. D. 810-961.
Spread of Venetian commerce and naval prowess.
{1808}
ITALY: A. D. 843-951.
In the breaking up of Charlemagne's Empire.
The founding of the Holy Roman Empire.
J. Bryce,
The Holy Roman Empire,
chapter 6.
ALSO IN:
F. Guizot,
History of Civilization,
lecture 24.
E. Gibbon,
Decline and Fall of the Roman Empire,
chapter 49.
See, also,
ROME: A. D. 903-964;
and ROMAN EMPIRE, THE HOLY: A. D. 963.
ITALY: A. D. 900-924.
Ravaged by the Hungarians.
E. Gibbon,
Decline and Fall of the Roman Empire,
chapter 55.
ITALY: A. D. 961-1039.
Subjection to Germany.
"Otho I., his son Otho II., and his grandson Otho III., were
successively acknowledged emperors and kings of Italy, from
961 to 1002. When this branch of the house of Saxony became
extinct, Henry II. of Bavaria, and Conrad the Salic of
Franconia, filled the throne from 1004 to 1039. During this
period of nearly eighty years, the German emperors twelve
times entered Italy at the head of their armies, which they
always drew up in the plains of Roncaglia near Placentia;
there they held the states of Lombardy, received homage from
their Italian feudatories, caused the rents due to be paid,
and promulgated laws for the government of Italy. A foreign
sovereign, however, almost always absent, known only by his
incursions at the head of a barbarous army, could not
efficaciously govern a country which he hardly knew, and where
his yoke was detested. … The emperors were too happy to
acknowledge the local authorities, whatever they were,
whenever they could obtain from them their pecuniary dues:
sometimes they were dukes or marquises, whose dignities had
survived the disasters of various invasions and of civil wars;
sometimes the archbishops and bishops of great cities, whom
Charlemagne and his successors had frequently invested with
duchies and counties escheated to the crown, reckoning that
lords elected for life would remain more dependent than
hereditary lords; sometimes, finally, they were the
magistrates themselves, who, although elected by the people,
received from the monarch the title of imperial vicars, and
took part with the nobles and prelates in the Plaids
(placita), or diets of Roncaglia. After a stay of some months,
the emperor returned with his army into Germany; the nobles
retired to their castles, the prelates and magistrates to
their cities: neither of these last acknowledged a superior
authority to their own, nor reckoned on any other force than
what they could themselves employ to assert what they called
their rights. Opposite interests could not fail to produce
collision, and the war was universal."
J. C. L. de Sismondi,
History of the Italian Republics,
chapter 1.
{1809}
H. Hallam,
The Middle Ages,
chapter 3, part 1 (volume 1).
J. Michelet,
History of France,
book 4, chapter 2.
The two elder of the sons of Tancred were now dead, and the
third son, Humphrey, died not long after. A fourth brother,
Robert, surnamed Guiscard, who had lately arrived from
Normandy with reinforcements, then established himself (A. D.
1057) with some difficulty in the leadership and succession.
"He accomplished the reduction of almost all the country which
composes the present kingdom of Naples, and, extinguishing the
long dominion of the Beneventine Lombards and of the eastern
empire in Italy [see BENEVENTUM, and AMALFI], finally received
from Pope Nicholas II. the confirmation of the titles which he
had assumed, of duke of Calabria and Apulia [A. D. 1080]. …
While Robert Guiscard was perfecting his dominion on the
continent, his younger brother Roger engaged in the
astonishing design of conquering the large and beautiful
island of Sicily from the Saracens with a few Norman
volunteers. An air of romantic extravagance breathes over all
the enterprises of the Normans in Italy; and, even if we
discard the incredible tales which the legends and chronicles
of the times have preserved of the valour and corporeal
strength of these northern warriors, enough will remain in the
authentic results of their expeditions to stagger the reason
and warm the imagination with attractive visions of chivalrous
achievement. … We are assured that 300 Christian knights
were the greatest number which Roger could for many years
bring into the field; and that 136 routed a prodigious host of
Saracens at the battle of Ceramio. … But the Saracens were
embroiled in internal discord, and their island was broken up
into numerous petty states; we may, therefore, attribute to
their dissensions a great part of the success which the
chroniclers of the Normans have assigned to their good swords
alone. Roger had, however, embarked in an arduous and
laborious undertaking, which it required the unbending
perseverance and patient valour of thirty years [A. D.
1060-1090] to accomplish. … At length, all Sicily bowed to
his sway; Norman barons were infeuded over its surface; and
Roger, with the title of great count, held the island as a
fief of his brother's duchy."
G. Proctor,
History of Italy,
chapter 2, part 2.
ALSO IN:
E. Gibbon,
Decline and Fall of the Roman Empire,
chapter 56.
J. W. Barlow,
Short History of the Normans in South Europe,
chapters 1-7.
{1810}
ITALY: A. D. 1056-1122.
Beginning of the conflict of the Popes with the Emperors.
Hildebrand and Henry IV.
The War of Investitures.