iOS 4 Programming Cookbook Solutions Examples for iPhone iPad and iPod touch Apps 1st Edition Vandad Nahavandipoor download pdf
iOS 4 Programming Cookbook Solutions Examples for iPhone iPad and iPod touch Apps 1st Edition Vandad Nahavandipoor download pdf
com
https://ebookname.com/product/ios-4-programming-cookbook-
solutions-examples-for-iphone-ipad-and-ipod-touch-apps-1st-
edition-vandad-nahavandipoor/
OR CLICK HERE
DOWLOAD NOW
https://ebookname.com/product/ios-7-programming-cookbook-2nd-edition-
vandad-nahavandipoor/
ebookname.com
https://ebookname.com/product/advanced-ios-4-programming-developing-
mobile-applications-for-apple-iphone-ipad-and-ipod-touch-1st-edition-
maher-ali/
ebookname.com
iOS Forensic Analysis for iPhone iPad and iPod touch 1st
Edition Sean Morrissey
https://ebookname.com/product/ios-forensic-analysis-for-iphone-ipad-
and-ipod-touch-1st-edition-sean-morrissey/
ebookname.com
https://ebookname.com/product/gustav-holst-a-research-and-information-
guide-routledge-music-bibliographies-1st-edition-mary-christison-
huismann/
ebookname.com
Teaching and Research Aptitude CBSE UGC NET SET JRF Paper
I 2nd Edition K. V. S. Madaan
https://ebookname.com/product/teaching-and-research-aptitude-cbse-ugc-
net-set-jrf-paper-i-2nd-edition-k-v-s-madaan/
ebookname.com
https://ebookname.com/product/a-little-history-of-the-world-e-h-
gombrich/
ebookname.com
https://ebookname.com/product/the-english-change-network-forcing-
changes-into-schemas-cristiano-broccias/
ebookname.com
https://ebookname.com/product/medieval-islamic-medicine-adil-s-gamal-
editor/
ebookname.com
https://ebookname.com/product/unix-and-linux-system-administration-
handbook-4th-edition-2010-evi-nemeth/
ebookname.com
Automobilities 1st Edition Mike Featherstone
https://ebookname.com/product/automobilities-1st-edition-mike-
featherstone/
ebookname.com
iOS 4 Programming Cookbook
Vandad Nahavandipoor
Published by O’Reilly Media, Inc., 1005 Gravenstein Highway North, Sebastopol, CA 95472.
O’Reilly books may be purchased for educational, business, or sales promotional use. Online editions
are also available for most titles (http://my.safaribooksonline.com). For more information, contact our
corporate/institutional sales department: (800) 998-9938 or [email protected].
Printing History:
January 2011: First Edition.
Nutshell Handbook, the Nutshell Handbook logo, and the O’Reilly logo are registered trademarks of
O’Reilly Media, Inc. iOS 4 Programming Cookbook, the image of an Egyptian mongoose, and related
trade dress are trademarks of O’Reilly Media, Inc.
Many of the designations used by manufacturers and sellers to distinguish their products are claimed as
trademarks. Where those designations appear in this book, and O’Reilly Media, Inc., was aware of a
trademark claim, the designations have been printed in caps or initial caps.
While every precaution has been taken in the preparation of this book, the publisher and author assume
no responsibility for errors or omissions, or for damages resulting from the use of the information con-
tained herein.
TM
ISBN: 978-1-449-38822-5
[M]
1294927300
To Agnieszka Marta Dybowska.
Table of Contents
Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi
v
2.15 Manipulating a Navigation Controller’s Array of
View Controllers 70
2.16 Incorporating a Tab Bar into Your Application 71
2.17 Pop Up Additional Information over iPad UI Elements 74
vi | Table of Contents
6.2 Parsing an XML File into Objects 204
6.3 Downloading Files Synchronously 213
6.4 Downloading Files Asynchronously 215
6.5 Reading and Parsing Remote XML Files 218
6.6 Caching Files in Memory 228
6.7 Caching Files on Disk 233
Index . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 595
Table of Contents | ix
Preface
I started developing iPhone applications in late 2007. Between then and now, I have
worked on various iPhone OS applications for different companies across the globe.
As you might have already guessed, iOS is my favorite platform and Objective-C is my
favorite programming language. I find that Objective-C helps programmers write clean
code and iOS helps developers write user-friendly and useful applications.
I have coded in other programming languages such as Assembly (using NASM and
TASM) and Delphi/Pascal for many years, and I still find myself going through disas-
sembled Objective-C code to find out which method of doing a certain thing or
accomplishing a certain result in Objective-C is better optimized on a certain device
and/or operating system.
After becoming comfortable with the iOS SDK, I gradually built up a thirst to write a
book about the iOS SDK, and with the help of wonderful people at O’Reilly, you are
now reading the result of the several hundred hours that have been put into writing
new material for iOS 3 and iOS 4, editing, reviewing, revising, and publishing.
So, please go ahead and start exploring the recipes. I hope you’ll find that they are easy
to cook and digest!
Audience
I assume you are comfortable with the iOS development environment and know how
to create an app for the iPhone or iPad. This book does not get novice programmers
started, but presents useful ways to get things done for iOS programmers ranging from
novices to experts.
xi
Here is a concise breakdown of the material each chapter covers:
Chapter 1, Working with Objects
Explains how Objective-C classes are structured and how objects can be instanti-
ated. The chapter talks about properties and delegates as well as memory man-
agement in Objective-C. Even if you are competent in Objective-C, I strongly
suggest that you go through this chapter, even if you are skimming through it, to
understand the basic material that is used in the rest of the chapters.
Chapter 2, Implementing Controllers and Views
Describes various approaches to constructing your iOS application’s user interface
by taking advantage of different tools the SDK provides. This chapter also intro-
duces you to features that are only available on the iPad, such as the popover and
split view controllers.
Chapter 3, Constructing and Using Table Views
Shows how you can work with table views to create professional-looking iOS
applications. Table views are very dynamic in nature, and as a result, programmers
sometimes have difficulty understanding how they should work with them. By
reading this chapter and having a look at and trying out the example code, you will
gain the knowledge that is required to comfortably work with table views.
Chapter 4, Core Location and Maps
Describes how you should use Map Kit and Core Location APIs to develop
location-aware iOS applications. First you will learn about maps, and then you will
learn how to detect a device’s location and tailor your maps with custom annota-
tions. You will also learn about geocoding and reverse geocoding, as well as some
of the methods of the Core Location framework, which are only available in the
iOS 4 SDK and later.
Chapter 5, Implementing Gesture Recognizers
Demonstrates how to use gesture recognizers, which enable your users to easily
and intuitively manipulate the graphical interface of your iOS applications. In this
chapter, you will learn how to use all available gesture recognizers in the iOS SDK,
with working examples tested on iOS 3 and iOS 4 on different devices such as the
iPhone 3GS, iPhone 4, and iPad.
Chapter 6, Networking and XML
Demonstrates how to download data from a URL and parse XML files. You will
learn about synchronous and asynchronous connections and their pros and cons.
You will also learn about caching files in memory and on disk to avoid consuming
the possibly limited bandwidth of an iOS device on which your application could
be running.
Chapter 7, Operations, Threads, and Timers
Provides details regarding operations, threads, and timers. Using the material in
this chapter, you can develop modern multithreaded iOS applications. In addition,
xii | Preface
you will learn about operations and operation queues, and how to avoid imple-
menting your own threads and instead let iOS do it for you.
Chapter 8, Audio and Video
Discusses the AV Foundation and Media Player frameworks that are available on
the iOS SDK. You will learn how to play audio and video files and how to handle
interruptions, such as a phone call, while the audio or video is being played on
both iOS 3 and iOS 4. This chapter also explains how to record audio using an iOS
device’s built-in microphone(s). At the end of the chapter, you will learn how to
access the iPod Library and play its media content, all from inside your application.
Chapter 9, Address Book
Explains the Address Book framework and how to retrieve contacts, groups, and
their information from the Address Book database on an iOS device. The Address
Book framework is composed entirely of C APIs. Because of this, many Objective-
C developers find it difficult to use this framework compared to frameworks that
provide an Objective-C interface. After reading this chapter and trying the exam-
ples for yourself, you will feel much more confident using the Address Book
framework.
Chapter 10, Camera and the Photo Library
Demonstrates how you can determine the availability of front- and back-facing
cameras on an iOS device. Some of the recipes in this chapter are specific to iOS
4, with the rest working on both iOS 3 and iOS 4. You will also learn how to access
the Photo Library using the Assets Library framework which is available in iOS 4
and later. At the end of the chapter, you will learn about editing videos right on an
iOS device using a built-in view controller.
Chapter 11, Multitasking
Explains, with examples, how to create multitasking-aware applications that run
beautifully on iOS 4. You will learn about background processing, from playing
audio and retrieving users’ locations in the background, to downloading content
from a URL while your application is running in the background.
Chapter 12, Core Data
Describes how to maintain persistent storage for your iOS applications using Core
Data. You will learn how to add to, delete from, and edit Core Data objects and
how to boost access to data in a table view. In addition, you will learn how to
manage relationships between Core Data objects.
Chapter 13, Event Kit
Demonstrates the use of the Event Kit and Event Kit UI frameworks, which are
available on iOS 4 and later, in order to manage calendars and events on an iOS
device. You will see how to create, modify, save, and delete events. You will also
learn, through examples, how to add alarms to calendar events and how to set up
CalDAV calendars so that you can share a single calendar among multiple devices.
Preface | xiii
Chapter 14, Graphics
Introduces the Core Graphics framework. You will learn how to draw images and
text on a graphics context, grab the contents of a graphics context and save it as
an image, and much more.
Chapter 15, Core Motion
Explains the Core Motion framework, which is new in iOS 4. Using Core Motion,
you will access the accelerometer and the gyroscope on an iOS device. You will
also learn how to detect shakes on a device. Of course, not all iOS devices are
equipped with an accelerometer and a gyroscope, so you will also learn how to
detect the availability of the required hardware.
Additional Resources
From time to time, I refer to official Apple documentation. Some of Apple’s descriptions
are right on the mark, and there is no point in trying to restate them. Throughout this
book, I have listed the most important documents and guides in the official Apple
documentation that every professional iOS developer should read.
For starters, I suggest that you have a look at the “iPhone Human Interface Guidelines”
and the “iPad Human Interface Guidelines.” These two documents will tell you every-
thing you should know about developing engaging and intuitive user interfaces for the
iPhone/iPod and the iPad. Every iOS programmer must read these documents. In fact,
I believe these documents must be read by the product design and development teams
of any company that develops iOS applications.
iPhone Human Interface Guidelines
http://developer.apple.com/library/ios/#documentation/userexperience/conceptual/
mobilehig/Introduction/Introduction.html
iPad Human Interface Guidelines
https://developer.apple.com/library/ios/#documentation/General/Conceptual/iPad
HIG/Introduction/Introduction.html
I also suggest that you skim through the “iOS Application Programming Guide” in the
iOS Reference Library for some tips and advice on how to make great iOS applications:
https://developer.apple.com/library/ios/#documentation/iPhone/Conceptual/iPho
neOSProgrammingGuide/Introduction/Introduction.html
One of the things you will notice when reading Chapter 11 is the use of block objects.
This book concisely explains block objects, but if you require further details on the
subject, I suggest you read “A Short Practical Guide to Blocks,” available at this URL:
https://developer.apple.com/library/ios/#featuredarticles/Short_Practical_Guide
_Blocks/index.html#//apple_ref/doc/uid/TP40009758
xiv | Preface
In Chapter 7, you will learn about operations. To be able to implement custom oper-
ations, as you will see later, you must have a basic knowledge of key-value coding
(KVC). If you require more information about KVC, I recommend that you read the
“Key-Value Coding Programming Guide,” available at the following URL:
https://developer.apple.com/library/ios/#documentation/Cocoa/Conceptual/KeyVa
lueCoding/KeyValueCoding.html
Throughout this book, you will see references to “bundles” and loading images and
data from bundles. You will read a concise overview about bundles in this book, but if
you require further information, head over to the “Bundle Programming Guide,” avail-
able at this URL:
https://developer.apple.com/library/ios/#documentation/CoreFoundation/Conceptu
al/CFBundles/Introduction/Introduction.html
Preface | xv
Other documents randomly have
different content
was therefore guilty of rebellion against Tiberius.[208] Pilate knew
perfectly well that the Jewish leaders were jealous of Jesus, and that
the charge was a mere pretence;[209] his Roman sense of justice
revolted against the execution of an innocent man; and he wished to
save Him; but they played upon his fears, and finally succeeded in
wringing a condemnation from him.[210] It was because the Roman
soldiers were struck with the extreme absurdity of the idea of Jesus
being a rival of Tiberius, that they got up their pitiable comedy of a
court, and did Him mock homage as King of the Jews.
So He was led away to Calvary and crucified, and above His head on
the cross was written, in three languages (Hebrew, Greek and Latin),
the charge against Him,—
Thus Jesus took good care that there should be no doubt as to what
He claimed to be: He did not write a book, nor cut an inscription on
a rock, but He let Himself be crucified, that all men to the end of
time might know that He claimed to be the Christ.[211]
Now let us see what He meant when He called Himself the Christ. To
get to understand this fully would be to learn the complete meaning
of His teaching; for it is such a perfect organism that every member
of it is closely related to every other member; yet we may gain
sufficient insight for our purpose from a broad survey.
The subject of the whole teaching of Jesus was the Kingdom of God.
He held that God had been working from the very beginning for the
winning of man to Himself, and that especially among His own
people Israel He had shown His hand. They had not only come to
know Him as the God of righteousness whose law was holiness; they
had enjoyed His love; they had experienced His mercy and His
power to redeem. But with the coming of Jesus Himself a new era of
the world had opened:[212] God was now drawing near to all men, in
a new relationship of love and mercy, with the purpose of saving
them.[213] This was the coming of the Kingdom of God.[214] The
history of Israel had been a long discipline in preparation for this.[215]
On the ground cleared in Israel, and on the basis of the revelation
already made to them, God would now reveal Himself to all men.
The destiny of Israel—“I will give thee for a light to the Gentiles”[216]
—would now be fulfilled.[217]
God, then, was about to enter into a new relationship with the whole
human race. That new relationship would be, like the old one with
Israel, characterized not only by His righteousness, but by His
redeeming love. His eternal purpose, which had been in
contemplation all through the centuries of Israel’s training, would
now be unfolded. The childhood of the world was over: its first
simple lessons had been learned; the real business of Time could
now be begun. The partial unveiling of God’s face which it had been
Israel’s privilege to behold would now become a full revelation in the
sight of the nations. The King of Israel would be seen to be the
Father of men. Further, as Israel had learned her lessons through
Jehovah’s redemptive acts at the Red Sea, on Zion, and in Babylon,
so mankind would learn the Father’s love through the great
redemptive acts involved in the coming of the Kingdom.
The chief conviction that Jesus had about Himself was that in and
through and by Him the Kingdom of God was coming: this it was
that constituted Him THE CHRIST. His self-consciousness is the most
marvellous phenomenon within the compass of history; there is
nothing else comparable with it. The primary element in it seems to
have been the knowledge that He was the true man, man as God
wishes Him to be, faultless both morally and religiously.[218] Closely
connected with this is another element, quite as unparalleled in
human experience, a feeling of close kinship to all men, a
consciousness of solidarity with the whole race and of personal
connection and sympathy with every individual.[219] These two
elements of His nature—His perfection as man, and His relationship
to the race as a whole—He summed up in the phrase which He used
so often to describe Himself, THE SON OF MAN.[220] Correspondent
to this double relationship to man stands a double relationship to
God: first, He stands in the closest personal kinship to God—the Son
with the Father—; so that He alone can reveal God, and God alone
can reveal Him;[221] and secondly, He is God’s representative to the
human race.[222] This dual relation to God He expressed by calling
Himself THE SON OF GOD.[223]
The life of a being of this order, standing in great, pregnant relations
to God on the one hand and to the human family on the other,
would necessarily be of transcendent significance. So we find that
He regarded His own words and acts and all the great experiences of
His life as of supreme importance in the history of the world:[224] His
coming opens a new era;[225] His public life is a wedding feast in the
otherwise grey experience of men;[226] His teaching is the final
revelation of God;[227] His acts are glimpses of the divine activity;[228]
His death, which to the casual observer is but a coarse judicial
murder, is the solemn sacrifice that ratifies the establishment of the
new relationship between God and man.[229]
Since such were the chief convictions Jesus held about Himself and
His mission, authority was naturally the chief note of His teaching.
His hearers marked that characteristic at the very outset;[230] and a
modern student cannot fail to be impressed with it as he reads the
Gospels. He states quite frankly that He has come to fulfil the law
and the prophets;[231] He sets up His own “I say unto you” not only
against the Jewish traditions,[232] but against the definite provisions
of the Mosaic law;[233] and over and over again He demands from
men such love, faith, submission, obedience, as can be rightly given
only to a Divine Master.[234]
In Jesus of Nazareth, then, we have a historical person, whose time
and environment are well known to us, and whose teaching and life
also stand out clear and unmistakable; and the most prominent
thing about Him is this, that, by word and deed, and finally by His
crucifixion, He made it clear to all men that He claimed to be both
Son of Man and Son of God.
Here, then, we have the secret of that similarity which we are all so
clearly conscious of, when we read a Gospel alongside of the Gītā. In
the Gospels we have in historical form the authoritative utterances of
the historical Jesus; in the Gītā we have the imaginations of a poet-
philosopher who was clear sighted enough to realize that an
incarnate god would have many things to say about himself, and
that his teaching would bear the note of authority. When, however,
we look for exact parallels between the two, they are hard to find:
the books are so utterly diverse in origin and teaching that they have
little in common except the tone of the master. In a few cases,
however, the resemblance is rather striking: here, then, we place
side by side the words of Jesus and the imaginations of the writer of
the Gītā.
Sayings of Jesus.
All authority hath been given unto me in heaven and on earth.
Matt., 28, 18.
I know the things which have been, those which are, and
those which are to be; but me nobody knows. VII, 26.
Come unto me, all ye that labour and are heavy laden, and I will
give you rest. Matt., 11, 28.
But that ye may know that the Son of Man hath authority on
earth to forgive sins,—Mark, 2, 10.
Of all mortals, he who knows me to be unborn, without
beginning, the great Lord of the world, being free from
delusion, is released from all sins. X, 3.
If any man would come after me, let him deny himself, and take
up his cross, and follow me. Mark, 8, 34.
Come unto me, all ye that labour and are heavy laden, and I will
give you rest. Matt., 11, 28.
In him seek shelter with all thy might: by his grace thou
shalt attain supreme peace, the eternal dwelling-place. XVIII,
62.
It would lead us far afield to set forth in detail all the striking things
that Jesus has to say about His own person and mission, but it may
be well to quote a few passages exhibiting lines of character and
thought not exemplified above:—
(a) His meekness and lowliness.
“The foxes have holes, and the birds of heaven have nests; but
the Son of Man hath not where to lay His head.” Luke, 9, 58.
“And He began to teach them, that the Son of Man must suffer
many things, and be rejected by the elders, and the chief
priests, and the scribes, and be killed, and after three days rise
again.” Mark, 8, 31.
“Many will say to Me in that day, Lord, Lord, did we not prophesy
by Thy name, and by Thy name cast out devils, and by Thy
name do many mighty works? And then will I profess unto them,
I never knew you: depart from Me, ye that work iniquity.” Matt.,
7, 22-23.
The Gītā is one of the most eloquent possible proofs of the fact that
the human heart cries out for an incarnate Saviour. Scarcely less
impressive is the evidence furnished by the reception of the Gītā by
Hindu readers: not the greatest of the Upanishads, neither the
Chāndogya nor the Katha, has had one quarter of the influence
exercised by this late poem; and the secret undoubtedly is to be
found in the attraction of the man-god Krishna. How many
generations of pious readers have found in the story of the life and
teaching of the incarnate god something to which their deepest and
most persistent religious instincts have responded! How many to-day
turn to Krishna in their trials and troubles!
On the one hand, then, we have the imaginative portrait of Krishna,
surrounded by millions of adoring worshippers—touching spectacle!
On the other, stands the historical Jesus of Nazareth, Son of Man
and Son of God, stretching out His nail-pierced hands to India, as He
says, “Come unto Me, all ye that labour and are heavy laden, and I
will give you rest.” Rightly read, the Gītā is a clear-tongued prophecy
of Christ, and the hearts that bow down to the idea of Krishna are
really seeking the incarnate Son of God.
IV. We have been able to see some little distance into the self-
consciousness of Jesus, and to realize in part at least that on which
He grounds His claim to the heart of every man; but we have not yet
learned the secret of that most marvellous of His powers, His power
to win human love. To that we must now address ourselves.
It is a well-known fact of history that, shortly after the death of
Christ, His followers began to preach in His name, and that very
soon the new faith began to spread rapidly. We have already learned
from Tacitus that in 64 A. D. there was “an immense multitude” of
Christians in Rome itself. Now the greatest of all the early
missionaries was Paul. He was the apostle of Europe. We mention
his name here, because we wish to refer to one of his Epistles.
These letters are the earliest of our Christian documents. The series
begins with two brief letters, both written, with a short interval
between them, to the church at Thessalonica. The most probable
date for them is 49 A. D., that is, only twenty years after the death
of Christ. But the letter we wish to use is one sent from Ephesus to
the church of Corinth[235] about 55 A. D.,[236] that is, twenty-six years
after the death of Jesus. We must not stay here to speak of the
splendour of the ethical feeling and teaching of the Epistle further
than to say that it manifestly has its source in Jesus. We must direct
our attention to other facts which appear in it.
Christianity, we note, has already spread from Judæa into the
provinces of Asia[237] and Galatia[238] in Asia Minor, and Macedonia[239]
and Achaia[240] in Europe. Phœnicia, Syria, Cilicia and Cyprus are not
mentioned; but we know from other sources[241] that they too were
already evangelized. Thus in twenty-six years the Church of Christ
has become a great organization, extending through many lands, yet
conscious of its unity in Christ.[242] We note also that then, as to-day,
BAPTISM is a solemn ceremonial act, in which a man through the
action of the Holy Spirit becomes a member of the body of Christ,
[243]
while THE LORD’S SUPPER is a recurrent feast, in which the
members of the Church have fellowship with the Lord and with each
other.[244]
But what we would call special attention to is the place assigned to
Christ in the Epistle. With reference to the Christian, Christ is THE
LORD;[245] with reference to the Father, He is THE SON;[246] He is
spoken of as the Lord of Glory,[247] the Power of God,[248] and the
Wisdom of God;[249] and prayer is offered to Him.[250] All spiritual
authority and power are attributed to Him.[251] The Church is His
body,[252] and He supplies His grace and power to every member.[253]
He will come back again to earth in glory,[254] and will then reveal all
secrets and judge all men.[255]
But there is another point still more noteworthy, and that is the way
in which the crucifixion of Christ is interpreted. Instead of regarding
that judicial murder as a regrettable incident, like the assassination
of Cæsar or the death of Socrates, Paul and his fellow-believers
glory in it,[256] not only as the crowning event of the divine revelation
made in Christ, but as the consummation of His work as the Saviour
of men.[257] Paul makes it the basis of all his preaching,[258] and in it
he finds all the wealth of spiritual wisdom which Christianity
contains.[259] He contrasts the wisdom of God wrapped up in that
divine tragedy with the worldly wisdom of earthly rulers.[260]
What can be the explanation of this extraordinary attitude to such an
event?—The basis of it is the solemn declaration, which Paul makes
in the Epistle, and which he says he made to his converts first of all,
that ON THE CROSS CHRIST DIED FOR OUR SINS.[261] The
crucifixion, as a bare event in history, is but an act of wicked folly on
the part of the rulers of Judæa; but, viewed from the standpoint of
morality and religion, it is a divine act of world-wide significance. In
the blood of Christ a new covenant had been made between God
and man.[262] This is the Gospel, which all the Apostles teach, and
which all the churches believe.[263] Through faith in Christ, on the
basis of this tremendous assertion, the Corinthian Christians, like the
rest, had been saved,[264] i.e., they had received the forgiveness of
their sins[265] and the sanctifying Spirit.[266] They thus no longer
belonged to themselves: they had been bought with a great price,
the blood of the Son of God.[267] They were no longer part and parcel
of heathen society; each one was a member of the body of Christ.
[268]
What led Paul and all the other Apostles and all the early Christians
to form such an extraordinary theory? How did they come to the
conclusion that the crucifixion was not a squalid tragedy, but a divine
sacrifice? This letter tells us quite plainly; the reasons were these:
Jesus Himself declared before He was crucified, that His death was
to be the basis of the New Covenant,[269] and this declaration of His
had been divinely confirmed by His Resurrection.[270]
Now mark: this letter was written within twenty-six years of the
event. The majority of the twelve Apostles, and multitudes of other
men who had known Jesus, were still alive.[271] Paul’s good faith is
beyond all question; and, as he was intimate with Peter and John
and the rest of the Apostles, and also with James the brother of
Jesus,[272] he had access to the very best information possible.
Further he had been one of the most violent opponents of
Christianity. His testimony is, therefore, evidence of the very highest
value. We may conclude, then, with the utmost certitude that we are
standing on an immoveable historical foundation, when we say that
Jesus, before His crucifixion, said He was about to die for the sins of
men.
But this evidence does not stand alone. It is a historical fact,
acknowledged by scholars of every school, that all Christian
churches have from the very beginning celebrated the Lord’s Supper.
[273]
Now this universal usage in so many churches, divided not only
by long distances but in many cases also by minor differences in
doctrine, cannot be explained at all except as a result of a command
of Jesus Himself. If any single disciple had started such a practice, it
could never have won its way to universal acceptance. Now consider
the significance of this fact: Jesus, on the night in which He was
betrayed, took bread, broke it, and bade His disciples eat it, saying,
‘This is My body.’ He then took a cup of wine and bade them drink it,
saying, ‘This is My blood.’[274] The scene is absolutely without a
parallel in the history of the world; and it can have but one meaning,
viz., that Jesus regarded His death as a sacrifice.
But the direct statement of Paul is corroborated, not only by the
institution of the Supper, but also by this fact, that the doctrine, that
Christ died for our sins, is an integral part of the teaching of Jesus as
that is handed down to us in the Gospels. We have already seen that
He held that His death was necessary for the establishment of the
Kingdom. We must now set out His teaching on this subject with a
little more fulness. We shall restrict ourselves to a single Gospel. In
the earliest saying that refers to it, His death is a future event,
coming inevitably, and destined to bring sorrow to His disciples. “And
Jesus said unto them, Can the sons of the bride-chamber mourn, as
long as the bridegroom is with them? but the days will come, when
the bridegroom shall be taken away from them, and then will they
fast.”[275] In the next it is much more clearly defined. Its necessity is
emphasized; we are told that the agents are to be the religious
leaders of Israel; and it is to be followed by the resurrection. “From
that time began Jesus to shew unto His disciples, how that He must
go unto Jerusalem, and suffer many things of the elders and chief
priests and scribes, and be killed, and the third day be raised up.”[276]
Twice over this same prophecy is repeated, the last time with more
detail.[277] Then follows a most striking saying, in which He speaks of
His death as voluntary: it is a giving away of His life; and it is
explained as the climax of His life of service; for the gift is ‘a ransom
for many,’ that is a price paid, in order to redeem many from sin.
“The Son of Man came not to be ministered unto, but to minister,
and to give His life a ransom for many.”[278] We need not linger over
the next sayings, though each has its own interest.[279] The last
saying occurs in the account of the institution of the Supper. In these
words He teaches in the clearest way, first, that His death is to be
the ground of forgiveness, and secondly, that after His death He is to
be the source of the spiritual life and strength of His followers. “And
as they were eating, Jesus took bread, and blessed, and brake it;
and He gave to the disciples, and said, ‘Take, eat; this is My body.’
And He took a cup, and gave thanks, and gave to them, saying,
‘Drink ye all of it; for this is My blood of the covenant, which is shed
for many unto remission of sins.”[280] The teaching of Jesus is an
organic whole, and is incomplete without this, His own interpretation
of His death of shame.
Jesus, then, gave Himself up to death as the sacrifice for the sins of
men. Our Christian documents go on to declare that He rose from
the dead on the third day, and that this resurrection of His was
God’s confirmation of the sacrifice of His Son. That men should at
first sight disbelieve the astounding assertion, that the crucified
Jesus rose from the dead, is not to be wondered at; but the fact
remains. Sceptical scholars have laboured for centuries to explain
away this extraordinary occurrence, but no one of these scholars
themselves will venture to say that any explanation hitherto given is
satisfactory. The latest attempt, that made by Schmiedel in the
Encyclopædia Biblica, is a farcical failure. The following are the
adamantine facts which no rationalism has ever yet succeeded in
crushing or melting:—(a) the Christians declared that they had seen
Christ and spoken with Him after His resurrection; (b) they were
absolutely sincere in this belief[281]; (c) the Christian Church arose as
a result of this conviction; (d) the grave was empty. The account of
Christ’s appearances given in the fifteenth chapter of our Epistle is
well worth study. Those who wish to look into this question further
may consult Ballard’s Miracles of Unbelief, pp. 135 ff.
We have thus, by a serious historical inquiry, reached the conclusion,
that Jesus of Nazareth, the founder of the Christian religion,
declared, before His crucifixion, that He was about to die for the sins
of men, and that this assertion of His was sealed with the divine
approval by the unique miracle of the resurrection. We have also
seen that this was the Good News, which Paul and all the other
Apostles preached, and on which the early Church was founded. It is
this that has won for Jesus the love of myriads; it is this that has
been the magnet to draw them away from sin. It is the source of the
joy and vital power of the Christian life.
Now let us recollect the poem upon The Servant of Jehovah, which
we considered in our third chapter. How marvellously Jesus
corresponds to the extraordinary idea which that poem discloses, the
despised and oppressed prisoner who endures in uncomplaining
meekness the uttermost shame of a violent death, and is finally
recognized as having been “pierced because of our trangressions,
and crushed because of our iniquities.” That anyone should write
such a poem, seems strange in the extreme; that Jesus should have
fulfilled it, is infinitely more wonderful.
How comes it that this Jewish carpenter, with His three years of
public life and His cross of shame, fulfils so many ideals and
aspirations? He brings in the new age which Virgil and his
contemporaries sighed for; He is Plato’s just man; He utters from His
own self-consciousness such things as the author of the Gītā
imagined an incarnate god would say; He gives Himself up to death,
in sheer love, as a sacrifice for sin, thus fulfilling the deepest needs
of man, as expressed by the old Hebrew seer; and He is the only
human being whom men of every race and clime can heartily admire
and unhesitatingly imitate. Nor is this all: many other convergent
lines of thought might be suggested, in the light of which Jesus
stands out as the ideal of our common humanity and the fountain of
the love of God.
How is all this to be explained? Wide chasms sever the Hindu sage,
the Greek philosopher, the Hebrew prophet and the Roman poet; yet
in Jesus their several ideals are reconciled in a loftier unity. Once in
the course of the centuries East and West have actually met! Nor
was the meeting merely the resolution of antitheses in a wider
conception: what the Jew and the Indian, the Greek and the Roman,
dreamed of as the unattainable, that Jesus actually accomplished in
this work-a-day world of ours, amid storms of the cruellest hatred
and calumny.—What is your candid opinion about Him, brother? How
are you to solve the problem raised by His life, death and place in
history? Can He be better described than in His own words, SON OF
MAN and SON OF GOD?
APPENDIX.
NEO-KRISHNA LITERATURE.
1884
Essays in Prachār on Krishnacharitra by Bunkim Ch. Chatterji.
1886
1. Krishnacharitra, Bunkim Ch. Chatterji, 1st edition. A volume in
Bengali prose on the character of Krishna.
1887
2. Raivatak, Nobin Ch. Sen. An epic poem in Bengali on Krishna’s
youth. 3. The Bhagavad Gītā, or the Lords Lay, Mohini M.
Chatterji. An English prose translation of the text and of parts of
Sankara’s commentary. An attempt is made to put the Gītā on
the same level as the New Testament.
1888
4. Krishna Jivani, Prosanna Kumar Vidyaratna. A life of Krishna in
Bengali prose.
1889
5. Srikrishner Jivana O Dharma, Gaur Gavinda Ray. The life and
religion of Krishna from the standpoint of the New Dispensation:
Bengali prose.
1890
6. Srimadbhagavadgītā, Krishnananda Swami (i.e. Krishna
Prasanna Sen). The text in the Bengali character with a Bengali
commentary and translation.
1892
Krishnacharitra, Bunkim Ch. Chatterji, 2nd edition. This edition
contains a great deal of new matter.
7. Amiya Nimai Charity, Shishir Kumar Ghose. First part. A life of
Chaitanya in Bengali prose.
1893
Amiya Nimai Charit. Second part.
8. Kurukshetra, Nobin Ch. Sen. An epic poem in Bengali on
Krishna at Kurukshetra.
1894
9. The Landmarks of Ethics according to the Gītā. Bulloram
Mullick.
Amiya Nimai Charit. Third part.
1895
10. Kālā Chānd Gītā, Shishir Kumar Ghose. A sort of Krishnaite
Song of Solomon in Bengali verse. It is said to have been
composed in 1888.
1896
11. Srikrishna, his Life and Teachings, Dhirendra Nath Pal. 3 vols.
12. Srikrishner Kalanka Kena? Nava Kumar Devasarma. A Bengali
prose defence of the character of Krishna.
13. The Bhagavad Gītā, Annie Besant. New and revised edition.
An English prose translation with an introduction and a few
notes.
14. Prabhās, Nobin Ch. Sen. An epic poem in Bengali on the later
years of Krishna’s life.
1897
15. Lord Gaurānga, Shishir Kumar Ghose, 1st volume. A life of
Chaitanya in English prose, with a discussion of the doctrine of
Incarnations.
1898
16. Krishna and Krishnaism, Bulloram Mullick.
Lord Gaurānga, 2nd volume.
17. Hindu Theism, Sitanath Tattvabhushan.
18. An Elementary Treatise on Universal Religion. Kshetra Mohan
Mukerji. The religion of the Gītā is here put forward as the
universal religion.
1899
19. Incarnation, Nanda Krishna Bose. This treatise follows in
most points the theory of Incarnation put forward in Lord
Gaurānga.
1900
20. The Young Men’s Gītā, Jogindranath Mukharji. An English
prose translation with introduction and notes.
21. Srimadbhagavadgītā, Prasanna Kumar Sastri, 2nd edition.
The text in the Bengali character, with several commentaries,
and a Bengali translation by Sasadhar Tarkachuramani.
1901
22. The Imitation of Sreekrishna, S. C. Mukhopadhaya. A daily
text-book, containing extracts in English from the Gītā, the
Mahābhārata, and the Bhāgavat Purāna.
23. Sree Krishna, Muralidhur Roy. An account, in English prose,
of the life and character of Krishna.
24. Srimadbhagavadgītā, Bhudhur Chattopadhaya, 4th edition.
The text in the Bengali character, with a Bengali commentary.
1903
25. A most elaborate edition of the Gītā, edited by Damudar
Mukerji, is being published in parts.
26. A Bengali verse translation of the Gītā by Satyendra Nath
Tagore is appearing in Bhārati.
Footnotes
1. The philosophic basis of the book is primarily the Sānkhya
system which is essentially atheistic.
5. E.g., X, 90.
7. X, 129.
15. Müller, A.S.L., 316 ff.; Macdonell, 218 ff.; Kaegi, 5; Bose, H.C.,
I, 12-19.
16. For the teaching of the Upanishads see Gough; Hopkins, R. I.,
Chap. X; Garbe, 7-10.
20. For the Sānkhya system, see Garbe, 10, 11, 29, 36, 45;
Macdonell, 390-395; Dutt, C. A. I., Vol. I, pp. 276 ff.
36. For the Yoga system, see Garbe, 14-15; Macdonell, 396-399;
Dutt, C. A. I., Vol. I, pp. 285 ff.
40. Macdonell, 239. Cf. Deussen, 543; Weber, I. L., 153 ff.
45. See Hopkins, G. E. I., Chap. VI; R.I. 350; Macdonell, 285-288.
49. Hopkins, R. I., Chaps. XIV and XV; Bose, H. C., Vol. I, 3.
58. G., X, 26. This is a noticeable point; for Kapila is the only
founder of a philosophical system known to the Epic; he alone
is authoritative in all philosophical matters. See Hopkins, G. E.
I., 97.
59. G., X, 24.
71. Mr. Justice Telang was inclined to put the date before the third
century B.C., but his otherwise most judicious criticism is faulty
in this that it does not take all the factors of the problem into
consideration. Others, such as Müller, Weber, Davies and
Lorinser, incline to a very late date, about the third century
A.D. Most writers believe that the true date lies between these
extremes. So Monier-Williams, Hopkins, Fraser and others.
Prof. Amalnerkar’s pamphlet contains a number of most
interesting points. His contention, that the phrase,
Brahmasūtrapadaih (G. XIII, 4) refers to the Vedānta Sūtras,
and that the Gītā is therefore the later work of the two, has
been accepted by Max Müller (S. S. I. P., 155), but Prof.
Hopkins thinks the Gītā is earlier than the Sūtra (R. I., 400).
The theory which Prof. Hopkins holds, that the Divine Song
was originally an Upanishad, and that it was redacted, first as
a Vishuite poem, and then a second time in the interests of
Krishnaism (R. I., 389), would account, on the one hand, for
the numerous inconsistencies in its teaching, and, on the other,
for the very conflicting signs of date which it presents. For a
criticism of Bunkim Chundra’s views, see the Appendix.
75. S. B. E., Vol. XIV, Index. Cf. Weber, I. L., 186; Krishnacharitra,
31.
76. 3, 17, 6. See Dutt, C. A. I., Vol. I, 189; Weber, I. L., 71; Bose,
H. C., Vol. I, 26; Hopkins, R. I., 465.
79. Dutt, C. A. I., Vol. I, 127; Bose, H. C., Vol. I, 33-34; Hopkins,
R. I., 403; Monier-Williams, 112.
87. For some amusing instances see Hopkins, R. I., 522, note, and
cf. Monier-Williams, Chap. X.
91. That it was only at a very late date that this identification took
place is evident from the fact that it is not once mentioned in
the early literature. Even in two of the Vishnu Upanishads of
the Atharva Veda, the Atmabodha, and the Nārāyana, Krishna
is referred to as a mere man. Apart from the Gītā and the
Mahābhārata, the earliest reference to him as God incarnate is
in the Gopālatāpanīyopanishad. See Weber, I. L., 169; and cf.
Welcome to our website – the ideal destination for book lovers and
knowledge seekers. With a mission to inspire endlessly, we offer a
vast collection of books, ranging from classic literary works to
specialized publications, self-development books, and children's
literature. Each book is a new journey of discovery, expanding
knowledge and enriching the soul of the reade
Our website is not just a platform for buying books, but a bridge
connecting readers to the timeless values of culture and wisdom. With
an elegant, user-friendly interface and an intelligent search system,
we are committed to providing a quick and convenient shopping
experience. Additionally, our special promotions and home delivery
services ensure that you save time and fully enjoy the joy of reading.
ebookname.com