0% found this document useful (0 votes)
31 views51 pages

iOS 4 Programming Cookbook Solutions Examples for iPhone iPad and iPod touch Apps 1st Edition Vandad Nahavandipoor download pdf

The document provides links to various eBooks related to iOS programming, including titles like 'iOS 4 Programming Cookbook' and 'iOS 7 Programming Cookbook' by Vandad Nahavandipoor. It also lists other educational resources on topics such as UNIX, medieval Islamic medicine, and music bibliographies. Users can download these eBooks in multiple formats from the specified website.

Uploaded by

nehrtiyana6n
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
31 views51 pages

iOS 4 Programming Cookbook Solutions Examples for iPhone iPad and iPod touch Apps 1st Edition Vandad Nahavandipoor download pdf

The document provides links to various eBooks related to iOS programming, including titles like 'iOS 4 Programming Cookbook' and 'iOS 7 Programming Cookbook' by Vandad Nahavandipoor. It also lists other educational resources on topics such as UNIX, medieval Islamic medicine, and music bibliographies. Users can download these eBooks in multiple formats from the specified website.

Uploaded by

nehrtiyana6n
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 51

Download the Full Version of the Ebook with Added Features ebookname.

com

iOS 4 Programming Cookbook Solutions Examples for


iPhone iPad and iPod touch Apps 1st Edition Vandad
Nahavandipoor

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

Download more ebook instantly today at https://ebookname.com


Instant digital products (PDF, ePub, MOBI) available
Download now and explore formats that suit you...

iOS 7 Programming Cookbook 2nd Edition Vandad


Nahavandipoor

https://ebookname.com/product/ios-7-programming-cookbook-2nd-edition-
vandad-nahavandipoor/

ebookname.com

Advanced iOS 4 Programming Developing Mobile Applications


for Apple iPhone iPad and iPod touch 1st Edition Maher Ali

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

Gustav Holst A Research and Information Guide Routledge


Music Bibliographies 1st Edition Mary Christison Huismann

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

A Little History of the World E. H. Gombrich

https://ebookname.com/product/a-little-history-of-the-world-e-h-
gombrich/

ebookname.com

The English Change Network Forcing Changes into Schemas


Cristiano Broccias

https://ebookname.com/product/the-english-change-network-forcing-
changes-into-schemas-cristiano-broccias/

ebookname.com

Medieval Islamic Medicine Adil S. Gamal (Editor)

https://ebookname.com/product/medieval-islamic-medicine-adil-s-gamal-
editor/

ebookname.com

UNIX and Linux System Administration Handbook 4th Edition


2010 Evi Nemeth

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

Beijing • Cambridge • Farnham • Köln • Sebastopol • Tokyo


iOS 4 Programming Cookbook
by Vandad Nahavandipoor

Copyright © 2011 Vandad Nahavandipoor. All rights reserved.


Printed in the United States of America.

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].

Editors: Andy Oram and Brian Jepson Indexer: Fred Brown


Production Editor: Kristen Borg Cover Designer: Karen Montgomery
Copyeditor: Audrey Doyle Interior Designer: David Futato
Proofreader: Andrea Fox Illustrator: Robert Romano
Production Services: Molly Sharp

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

This book uses RepKover™, a durable and flexible lay-flat binding.

ISBN: 978-1-449-38822-5

[M]

1294927300
To Agnieszka Marta Dybowska.
Table of Contents

Preface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . xi

1. Working with Objects . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1


1.1 Implementing and Using Custom Objects 2
1.2 Allocating and Initializing Objects 6
1.3 Defining Two or More Methods with the Same Name
in an Object 8
1.4 Defining and Accessing Properties 11
1.5 Managing Properties Manually 13
1.6 Reusing a Block of Code 16
1.7 Communicating with Objects 19
1.8 Invoking the Selectors of an Object Dynamically 25
1.9 Managing Memory with the iOS SDK 27
1.10 Managing Untyped Objects 29

2. Implementing Controllers and Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 31


2.1 Getting and Using the Application Delegate 31
2.2 Managing the Views in Your Application 33
2.3 Creating Your Application’s GUI 35
2.4 Making Your View Controller Available at Runtime 37
2.5 Using a View in Your Application’s GUI 39
2.6 Managing Master-Detail Views 41
2.7 Managing Multiple Views 48
2.8 Incorporating and Using Models in the GUI 50
2.9 Implementing Navigation Bars 54
2.10 Switching from One View to Another 61
2.11 Setting the Title on a Navigation Bar 62
2.12 Displaying an Image for the Title of the Navigation Bar 63
2.13 Creating and Managing Buttons on a Navigation Bar 64
2.14 Removing a View from a Navigation Controller 69

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

3. Constructing and Using Table Views . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 87


3.1 Creating a Table View Using Interface Builder 87
3.2 Creating a Table View Using Code 89
3.3 Assigning an Event Handler to a Table View Using
Interface Builder 90
3.4 Assigning an Event Handler to a Table View Using Xcode 92
3.5 Populating a Table View with Data 94
3.6 Receiving and Handling Table View Events 99
3.7 Using Different Types of Accessories in a Table View 100
3.8 Creating Custom Table View Accessories 103
3.9 Customizing the Appearance of a Table View’s Contents 105
3.10 Displaying Hierarchical Data 110
3.11 Effectively Managing Memory with Table Views 112
3.12 Editing and Moving Data in a Table View 115
3.13 Enabling Swipe Deletion 124
3.14 Grouping Data 127

4. Core Location and Maps . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141


4.1 Creating a Map Using Interface Builder 142
4.2 Creating a Map Using Code 143
4.3 Handling the Events of a Map 146
4.4 Pinpointing a Device’s Location 147
4.5 Displaying Built-in Pins on a Map View 151
4.6 Displaying Pins with Different Colors on a Map View 154
4.7 Creating and Displaying Custom Pins on a Map View 160
4.8 Retrieving Meaningful Addresses Using Spatial Coordinates 163
4.9 Retrieving Spatial Coordinates Using Meaningful Addresses 165

5. Implementing Gesture Recognizers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 173


5.1 Detecting Swipe Gestures 175
5.2 Reacting to Rotation Gestures 177
5.3 Detecting Panning and Dragging Gestures 185
5.4 Detecting Long Press Gestures 188
5.5 Responding to Tap Gestures 191
5.6 Responding to Pinch Gestures 194

6. Networking and XML . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197


6.1 Opening and Reading a Local XML File 197

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

7. Operations, Threads, and Timers . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 251


7.1 Running Tasks Synchronously 253
7.2 Running Tasks Asynchronously 261
7.3 Creating a Dependency Between Tasks 269
7.4 Performing a Task After a Delay 272
7.5 Performing Periodic Tasks 273
7.6 Performing Periodic Tasks Efficiently 278
7.7 Initializing Threads Implicitly 284
7.8 Exiting Threads and Timers 285
7.9 Avoiding Memory Leaks in Threads 288

8. Audio and Video . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293


8.1 Playing Audio Files 293
8.2 Handling Interruptions While Playing Audio Files 297
8.3 Recording Audio Files 298
8.4 Handling Interruptions While Recording Audio Files 305
8.5 Playing Audio over Other Sounds That Are Playing 307
8.6 Playing Video Files 311
8.7 Capturing Thumbnails from a Video File Asynchronously 315
8.8 Accessing the iPod Library in Response to a User Request 319

9. Address Book . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 327


9.1 Accessing the Address Book 328
9.2 Retrieving All the People in the Address Book 331
9.3 Retrieving Properties of Address Book Entries 332
9.4 Inserting a Person Entry in the User’s Address Book 336
9.5 Inserting a Group Entry in the User’s Address Book 339
9.6 Adding Persons to Groups 341
9.7 Searching in the Address Book 344
9.8 Retrieving and Setting a Person’s Address Book Image 350

10. Camera and the Photo Library . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 357


10.1 Detecting and Probing the Camera 359
10.2 Taking Photos with the Camera 364
10.3 Taking Videos with the Camera 368
10.4 Storing Photos in the Photo Library 372

Table of Contents | vii


10.5 Storing Videos in the Photo Library 375
10.6 Retrieving Photos and Videos from the Photo Library 378
10.7 Retrieving Assets from the Assets Library 380
10.8 Editing Videos on an iOS Device 388

11. Multitasking . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 399


11.1 Detecting the Availability of Multitasking 401
11.2 Completing a Long-Running Task in the Background 402
11.3 Receiving Local Notifications in the Background 407
11.4 Playing Audio in the Background 415
11.5 Handling Location Changes in the Background 419
11.6 Saving and Loading the State of a Multitasking iOS Application 424
11.7 Handling Network Connections in the Background 430
11.8 Handling Notifications Delivered to a Waking Application 435
11.9 Handling Locale Changes in the Background 438
11.10 Responding to Changes in an Application’s Settings 440
11.11 Opting Out of Background Execution 442

12. Core Data . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 445


12.1 Creating a Core Data Model with Xcode 447
12.2 Creating and Using Core Data Model Classes 451
12.3 Creating and Saving Data Using Core Data 453
12.4 Loading Data Using Core Data 456
12.5 Deleting Data Using Core Data 458
12.6 Sorting Data Using Core Data 477
12.7 Boosting Data Access in Table Views 480
12.8 Implementing Relationships with Core Data 492

13. Event Kit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 499


13.1 Retrieving the List of Calendars 502
13.2 Adding Events to Calendars 504
13.3 Accessing the Contents of Calendars 507
13.4 Removing Events from Calendars 512
13.5 Adding Recurring Events to Calendars 523
13.6 Retrieving the Attendees of an Event 528
13.7 Adding Alarms to Calendars 534
13.8 Handling Event Changed Notifications 537
13.9 Presenting Event View Controllers 540
13.10 Presenting Event Edit View Controllers 546

14. Graphics . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 551


14.1 Drawing Basic Shapes on a Graphics Context 552
14.2 Drawing Paths on a Graphics Context 555

viii | Table of Contents


14.3 Drawing Images on a Graphics Context 561
14.4 Capturing the Screen Contents into an Image 563
14.5 Drawing Text with Core Graphics 568

15. Core Motion . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 573


15.1 Detecting the Availability of an Accelerometer 574
15.2 Detecting the Availability of a Gyroscope 577
15.3 Retrieving Accelerometer Data 578
15.4 Detecting a Shake on an iOS Device 584
15.5 Retrieving Gyroscope Data 590

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.

Organization of This Book


In this book, we will discuss frameworks and classes that are available in iOS 3 and iOS
4. In some recipes, you will find code that runs only on iOS 4 and later; in those recipes,
I note that you will need the iOS 4 SDK or later to compile the example code.

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

Conventions Used in This Book


The following typographical conventions are used in this book:
Italic
Indicates new terms, URLs, filenames, file extensions, and directories
Constant width
Indicates variables and other code elements, the contents of files, and the output
from commands
Constant width bold
Highlights text in examples that is new or particularly significant in a recipe
Constant width italic
Shows text that should be replaced with user-supplied values

This icon signifies a tip, suggestion, or general note.

Using Code Examples


This book is here to help you get your job done. In general, you may use the code in
this book in your programs and documentation. You do not need to contact us for
permission unless you’re reproducing a significant portion of the code. For example,
writing a program that uses several chunks of code from this book does not require
permission. Selling or distributing a CD-ROM of examples from O’Reilly books does
require permission. Answering a question by citing this book and quoting example

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,—

JESUS OF NAZARETH, THE KING OF THE JEWS.

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.

Verses from the Gītā.


Nature gives birth to movables and immovables through me,
the supervisor, and by reason of that the universe revolves.
IX, 10.

All things have been delivered unto me of my Father: and no one


knoweth who the Son is, save the Father; and who the Father is,
save the Son, and he to whomsoever the Son willeth to reveal
him. Luke, 10, 22.

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.

Forsaking all duties, come to me as thy sole refuge. I will


release thee from all sins: do not grieve. XVIII, 66.

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.

In thought renouncing all actions unto me, intent on me,


applying thyself to the yoking of thine intellect, be thou
always thinking of me. XVIII, 57.

So, therefore, whosoever he be of you that renounceth not all


that he hath, he cannot be my disciple. Luke, 14, 33.

Having thyself yoked by the yoke of renunciation, thou shalt


come to me. IX, 28.

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.

If they have called the master of the house Beelzebub, how


much more shall they call them of his household? Matt., 10, 25.

hating me in their own bodies and in those of others. XVI,


18.

And blessed is he, whosoever shall find none occasion of


stumbling in me. Matt., 11, 6.

Deluded people, ... not knowing my highest nature as great


lord of entities, disregard me, as I have assumed a human
body. IX, 11.
My yoke is easy, and my burden is light. Matt., 11, 30.

To the constantly-yoked Yogi, who constantly remembereth


me, never thinking of another, I am easy of access. VIII, 14.

Learn of me. Matt., 11, 29.


Learn from me. XVIII, 50.

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.

“I am meek and lowly in heart.” Matt., 11, 29.

(b) The conditions of His earthly life.

“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.

(c) The necessity that He should die for men.

“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.

(d) His spirit of service and self-sacrifice.

“Even as the Son of Man came not to be ministered unto, but to


minister, and to give His life a ransom for many.” Matt., 20, 28.
“But I am among you as he that doth serve.” Luke, 22, 27.

(e) His claims on the allegiance and love of men.


“Every one who shall confess Me before men, him shall the Son
of Man also confess before the angels of God: but he that
denieth Me in the presence of men shall be denied in the
presence of the angels of God.” Luke, 12, 8-9.
“He that loveth father or mother more than Me is not worthy of
Me; and he that loveth son or daughter more than Me is not
worthy of Me.” Matt., 10, 37-38.

(f) His universal sympathy.

“Inasmuch as ye did it unto one of these My brethren, even


these least, ye did it unto Me.” Matt., 25, 40.

(g) His declaration that he will return to judge all men.

“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.

(h) His presence with his followers.

“For where two or three are gathered together in My name,


there am I in the midst of them.” Matt., 18, 20.

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.

The Neo-Krishna movement is about twenty years old. Before 1880


Vaishnavism does not seem to have been in great favour with the
higher castes of Bengal. Traditionally they were Saivas or Sāktas
rather than Vaishnavas; and English education, which bore very
heavily for half a century on every form of Hinduism seems to have
told with peculiar severity on Krishnaism. But shortly after 1880 a
great change becomes visible: Krishna begins to be praised on every
hand, and ancient Vaishnava books are read and studied with
avidity. The new movement seems to have owed its origin, on the
one hand, to the teaching and influence of Ramkrishna Paramhansa,
Keshub Chundra Sen, Bijoy Krishna Goswami and Shishir Kumar
Ghose; and on the other, to the efforts of two or three noteworthy
literary men, who threw themselves into the task of painting the
character of Krishna with extraordinary enthusiasm. The Gītā at once
leaped into greater prominence than ever: numberless editions and
translations of it have been published. Many essays have appeared
comparing Krishna with Christ and Vaishnavism with Christianity.
Thus a large Krishna literature, both in English and Bengali, has
sprung up. The following seem to be the more important books of
this 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.

This revival of interest in Krishna and his worship is clearly part of


the great national movement which has been so potent in Bengal,
religiously, socially and politically, these last twenty years. This
period has witnessed the appearance of the whole Neo-Hindu
movement, with its literature, lectures, societies and missionary
propaganda, the rise of the Indian National Congress and of the
social reform movement, the advance of native journalism to its
present extraordinary influence, and the establishment of the native
unaided colleges, which have so seriously changed the balance of
influence in Higher Education. Neo-Krishnaism, then, is one result of
the operation of that potent spirit whereby India has become
conscious of her unity, and her sons have been roused to a vigorous
defence of all that they have inherited from the past. This rise of the
national spirit, though it may be troublesome in small matters to the
rulers of India, is undoubtedly the last and greatest justification of
English rule; and, while, with its exaggerations and insincerities and
follies, it cannot fail to provoke criticism,[282] yet its power to awake
self-reliance, self-respect and the passion for freedom ought to win
for it the approval and the encouragement of all good men.
There can be no doubt that among the influences which have
produced Neo-Hinduism, Christianity is one of the most potent, if not
the chief. This is peculiarly evident in the case of the Neo-Krishna
literature we are discussing. In 1899 the Bengal Librarian wrote,
“There is no denying the fact that all this revolution in the religious
belief of the educated Hindu has been brought about as much by the
dissemination of Christian thought by Missionaries as by the study of
Hindu scriptures; for Christian influence is plainly detectable in many
of the Hindu publications of the year.” But beyond this general
influence, which cannot fail to be noticed by anyone who will take
the trouble to read the volumes, it is, we believe, perfectly plain that
the very ideas which have given birth to the literature are the result
of Christian influence. A distinct taste for such books as the Gospels
has sprung up; and men have come to feel the need of a perfect
character, such as Christ’s is, for daily contemplation and imitation.
The Neo-Krishna movement endeavours to supply these needs from
within Hinduism, offering the Gītā instead of the Gospels, and
Krishna instead of Christ.[283]
Nobin Ch. Sen seems to have been the first to conceive the idea of a
modern rendering of the character of Krishna; for he laid the project
before some of his friends in 1882.[284] His famous epic trilogy,
Raivatak, Kurukshetra and Prabhās, are the result of this pregnant
thought. But, while he and Shishir Kumar Ghose have done a great
deal to popularize the movement, there can be no doubt that
Bunkim Ch. Chatterji’s Krishnacharitra has been by far the most
influential volume in the whole of this literature. Gaur Gavinda Ray’s
work, Srikrishner Jivana O Dharma, is a piece of excellent
characterization, and has won the high regard of many thoughtful
men.
The books on our list fall into two classes, Historical and Traditional.
In the Historical class there are only two volumes, Tattvabhusan’s
Hindu Theism, and the Young Men’s Gītā. These two frankly
acknowledge that the Gītā is a late book. In the Young Men’s Gītā[285]
its date is said to be a century or two before, or a century or two
after, the Christian era; while in Hindu Theism[286] the Gītā is
regarded as the point of transition from the old Vedānta to the
religion of the Purānas. The standpoint of these two books is thus
thoroughly historical, but it necessarily implies the abandonment of
the divinity of Krishna.
All the rest of the books on the list fall into the second class; for they
hold the traditional position about Krishna. Most of them make no
attempt at criticism of the sources, but treat the Mahābhārata, the
Gītā, the Harivansa and the Purānas as all historical and all equally
trustworthy. A few of the authors, however, state plainly their own
critical conclusions, and two or three enter into some discussion of
the main problems. These attempts at criticism are the most pitiable
parts of the whole literature. The talented author of Srikrishner
Jivana O Dharma, by far too sincere and candid to ignore the
Puranic elements in the sources, frankly confesses their presence;
yet, believing these books to be genuine representatives of the age
of Kurukshetra, he is driven to the extraordinary conclusion that the
Vedic, the Vedantic, and the Puranic ages were contemporaneous.
[287]
The late Bulloram Mullick, in discussing the eighteen Purānas,
goes so far as to say, “Whatever may be the views of European
savants, there is indubitable proof that some of these Purānas
existed in the eleventh or twelfth century before Christ.”[288] Even
Bunkim Chundra Chatterji himself not only unhesitatingly adopts
Goldstücker’s rash guess, that Pānini’s grammar was written before
the Brāhmanas and the Upanishads, but on the basis of that unwise
conjecture, pushes back Pānini’s date to the tenth or eleventh
century B. C.,[289] i.e., four or five centuries earlier than the pre-
Buddhistic date which Goldstücker[290] wished to establish. Dhirendra
Nath Pal, seeing that Bunkim Babu found it so easy to leap over a
few centuries, goes a little further and suggests the twelfth or
thirteenth.[291] But, indeed, without some such strange perversion of
history, it is impossible to construct an argument for the authenticity
of the Gītā and the historicity of the Mahābhārata that shall have
even the semblance of reason.
We note next that of all the books of the second class, Bunkim
Chundra’s Krishnacharitra is the only work that gives any
independent criticism: all the rest, with the single exception of
Srikrishner Jivana O Dharma, merely echo his arguments. Thus
Bunkim Babu’s theory is the only one we need discuss.
Now the whole critical structure of the Krishnacharitra rests upon the
passage on pages 41 and 42, where the date of Pānini is discussed.
Pānini is pushed back to 1000 B. C.; and, the ‘original’ Mahābhārata
being earlier than Pānini, we are asked to believe that it was
produced within a century or two of Kurukshetra, and that it is in
consequence trustworthy historically. The whole argument thus rests
on the date of Pānini.
We translate this important passage:—

“Goldstücker has proved that, when Pānini’s Sūtra was


composed, Buddha had not arisen. In that case Pānini must
belong to the sixth century B. C. But not only that, in his time
the Brāhmanas, the Aranyakas, the Upanishads and the other
parts of the Vedas had not been composed. Apart from the Rig,
the Yajur, and the Sāma Vedas, nothing else existed. Asvalāyana,
Sānkhāyana and the rest had not appeared. Max Müller says that
the age in which the Brāhmanas were composed began about
1000 B. C. Dr. Martin Haug says that that was the end of the
age, and that it began in the fourteenth century B. C. Therefore,
if we say that Pānini must belong to the tenth or eleventh
century B. C., we do not say too much.”
Now the first remark we make on this extraordinary piece of criticism
is this, that Goldstücker and Max Müller are most unfairly conjoined
to support a date which both of them would have indignantly
repudiated. For Müller’s date for Pānini is the fourth century B.C.,[292]
and Goldstücker never proposed to push him further back than the
sixth century; indeed all that he claims is that he has brought
forward evidence which affords a strong probability that Pānini
preceded the origin of the Buddhistic creed.[293] Our next remark is
that, though more than forty years have passed since Goldstücker’s
book appeared,[294] he has convinced no one that the Brāhmanas
and the Upanishads are posterior to Pānini’s grammar: opinions still
differ as to Pānini’s precise date, but no scholar to-day puts him
before the Brāhmanas.[295]
Can the grounds for this unanimity among modern scholars be
vividly set forth? We believe they can. Here, as in our first chapter,
we shall not attempt to fix a definite chronology, but shall simply aim
at reaching the relative age of the great books we are dealing with;
and we shall not deal with the meaning of disputed passages, but
shall rest the case altogether on the clear and prominent features of
history which every one can appreciate. There is, then, first of all the
great broad fact that the Sūtras depend on the Brāhmanas, and are,
in general, posterior to them, and that the language and style of
Pānini’s Sūtras show that he belongs to about the middle of the
Sūtra period.[296] All the detailed study of the last forty years has
gone to strengthen this stable conclusion.
But there is another and still more conclusive proof that Pānini
comes long after the early Brāhmanas. These ancient books are
written in Vedic Sanskrit.[297] The early Upanishads are more modern
in character, but even they belong to a stage of the language a good
deal earlier than the Sūtras: Professor Macdonell’s words are, “the
oldest Upanishads occupying a position linguistically midway
between the Brāhmanas and the Sūtras.”[298] Thus the Brāhmanas
were composed while Vedic Sanskrit was still the language of the
Indo-Aryans. Now Pānini’s grammar deals with classical Sanskrit, not
the Vedic speech. He deals with many points of Vedic grammar, it is
true, but he deals with them as exceptions; his subject is classical
Sanskrit. He laid down the law, which has ruled Sanskrit throughout
the centuries since his day. Thus he arose at a time, when the
language of the Brāhmanas had become archaic, and modern
Sanskrit had taken its place.[299] It is thus absolutely impossible to
believe that Pānini lived and wrote before the Brāhmanas were
composed: to propose to put him back before their composition is
much the same as proposing to push Johnson’s Dictionary back
before Chaucer.
Another line of proof may also be indicated. Careful study of the
early Brāhmanas has made it plain that they were composed after
the collection of the hymns of the Rigveda, but before[300] the
formation of the Sanhitā text (i.e., the text in which the words are
joined according to the rules of Sandhi) and the Pada[301] text (i.e.
the word by word text). The author of the Pada text is Sākalya.[302]
Now Yāska refers to Sākalya as a predecessor;[303] and Yāska himself
is earlier than Pānini.[304] Thus the historical order is the early
Brāhmanas, the Sanhitā text, Sākalya, Yāska, Pānini.
Bunkim Babu’s date for Pānini being thus altogether untenable, his
whole argument for the historicity of the Pāndava Mahābhārata and
Krishna’s character as therein pourtrayed tumbles in ruins, and
brings down with it all the rest of this Krishna literature.
We would invite our readers to turn away from these vain attempts
to turn a myth into sober history, and to listen to the teaching of
those really scholarly Indians who study Hinduism from a scientific
standpoint. We have already referred to Sitanath Tattvabhushan’s
Hindu Theism, and we have frequently used Bose’s Hindu Civilization
under British Rule and R. C. Dutt’s works as authorities. We would
now call attention to a monograph by one of the greatest scholars in
Bengal (Comparative Studies in Vaishnavism and Christianity, by
Brajendra Nath Seal), where[305] the growth of the Krishna legend is
frankly discussed;[306] also to a very remarkable essay on Buddhist
and Vishnuite in a recent number of Sāhitya[307] by the late Umes
Chundra Batabyal, in which grave historical reasons are given for
concluding that the Gītā is in part at least a polemic against
Buddhism; and to the late Mr. Justice Telang’s introduction to his
translation of the Gītā (S. B. E., vol. VIII), with regard to which
readers will note, that, although the date is put a little earlier than
most scholars would put it, no attempt is made to defend the
traditional theory of the origin of the Song.

Footnotes
1. The philosophic basis of the book is primarily the Sānkhya
system which is essentially atheistic.

2. Dr. Lorinser’s attempt (Die Bhagavadgītā, übersetzt und


erläutert von Dr. F. Lorinser, 1869) to prove that the author of
the Gītā borrowed many ideas from the Bible must be
pronounced a failure. Cf. Garbe, 19, 83-85; Max Müller, Natural
Religion, 97-100; Hopkins, R. I., 429.

3. On the religion of the Rigveda see Kaegi, 27-74; Hopkins, R. I.,


Chaps. II-VI; Macdonell, 67-115; Bose, H.C., I, 6-9; Dutt,
C.A.I., Vol. I, Chap. V; Monier-Williams, Chap. I.

4. Hopkins, R.I., 141; Macdonell, 385; Garbe, 1-2; Kaegi, 87.

5. E.g., X, 90.

6. X, 81; 82; 121.

7. X, 129.

8. Kaegi, 3; Macdonell, 171-174.

9. Kaegi, 4; Macdonell, 174-185.


10. Kaegi, 5; Macdonell, 202 ff.; Müller, A.S.L., Chap. II; Bose,
H.C., I, 9-12.

11. Müller, A.S.L., 389.

12. Hopkins, R.I., 177.

13. Gough, Chap. I; Garbe, 2-7; Macdonell, 223; Hopkins, R.I.,


204.

14. Müller, A.S.L., 313 ff.; Macdonell, 204; Kaegi, 5.

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.

17. See Deussen on each of these Upanishads, especially p. 264;


and Cf. Macdonell, 226.

18. Garbe, 10; Macdonell, 390, 393.

19. Führer, Monograph on Buddha Sakyamuni’s Birthplace, Arch.


Surv. of India, Vol. XXVI, Allahabad, 1897; Macdonell, 13.

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.

21. Macdonell, 393.

22. Macdonell, 226; Deussen, 261, 523, 288, 544, 241.

23. Deussen, 264.

24. Katha, 3, 10-13; 6, 6; 6, 7-11; 6, 14-18; Svet. passim;


Mundaka, 2, 1, 1-3; Mahānār, 63, 21. Cf. Deussen, ad loca.
25. Katha, 2, 23; Svet. 3, 20; Mundaka, 3, 2-3. Cf. Hopkins, R.I.,
238.

26. Svet. 6, 23.

27. Svet. 6, 13.

28. Müller, Anthrop. Rel., 345; Oldenberg, Budda, 56.

29. Weber, Sitz. Berli. Ak. 1890, p. 930.

30. I. L., 159.

31. Deussen, 291, 308.

32. Deussen, ad loca; Macdonell, 226.

33. Deussen, 242.

34. Deussen, ad loca; Macdonell, 226.

35. Garbe, 14; Macdonell, 396; Hopkins, R. I., 495.

36. For the Yoga system, see Garbe, 14-15; Macdonell, 396-399;
Dutt, C. A. I., Vol. I, pp. 285 ff.

37. Garbe, 16-18; Macdonell, 400-402.

38. Deussen, 4; Macdonell, 238; Dutt, C. A. I., Vol. I, 119; Garbe,


69.

39. Deussen, 541-543; Macdonell, 238-239.

40. Macdonell, 239. Cf. Deussen, 543; Weber, I. L., 153 ff.

41. Bose, H.C., Vol. I, 4.

42. Garbha, 4; Prānāgnihotra, 1; Sūlika, passim.


43. Macdonell, 428; Hopkins, G. E. I., 18-23.

44. Macdonell, 282-4.

45. See Hopkins, G. E. I., Chap. VI; R.I. 350; Macdonell, 285-288.

46. Hopkins, G. E. I., 397-398; Macdonell, 283-286. Bunkim


Chundra recognizes the second, third and fourth of these
stages: see Krishnacharitra, Chap. XI.

47. The Ordinances of Manu, Burnell and Hopkins, pp. XIX-XXVIII;


Macdonell, 428.

48. Hopkins, G. E. I., Chap. III; R. I., 265.

49. Hopkins, R. I., Chaps. XIV and XV; Bose, H. C., Vol. I, 3.

50. See Telang’s translation throughout, and cf. Hopkins, G. E. I.,


28-46; Amalnerkar, 4-5.

51. Telang, 15.

52. Cf. Hopkins, R. I., 429.

53. G., IV, 8.

54. Hopkins, R. I., 399.

55. G., IV, 1-3.

56. G., XVIII, 13.

57. G., XVIII, 19.

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.

60. See Hopkins, R. I., 414.

61. G., X, 27.

62. G., X, 27.

63. G., X, 28.

64. G., X, 31.

65. G., II, 72; V, 24; 25; 26; VI, 15.

66. Hopkins, G. E. I., 88; R. I., 427.

67. Mahābhārata, Bhīshma Parvan.

68. G., VIII, 24-25.

69. Amalnerkar, 13.

70. See Jacob’s Concordance to the Principal Upanishads and


Bhagavadgītā.

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.

72. Dutt, C. A. I., Vol. I, 9-11; Bunkim Ch. Chatterji,


Krishnacharitra, 46; Macdonell, 174-175, 285; Hopkins, R. I.,
33, 177-179.

73. Macdonell, 285; Weber, I. L., 90.

74. S. B. E., Vol. XII, pp. XLI-XLII; Macdonell, 213.

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.

77. Weber, I. L., 70.

78. Whether Krishna Angirasa in the Kaushītaki Brāhmana be the


same person as Krishna Devakiputra, or not, we cannot tell.

79. Dutt, C. A. I., Vol. I, 127; Bose, H. C., Vol. I, 33-34; Hopkins,
R. I., 403; Monier-Williams, 112.

80. The reference to Krishna and Arjuna runs


Vāsudevārjunābhyām vun (IV, 3, 98), words which put the two
on one level.

81. Hopkins, G. E. I., 390-395.

82. Hopkins, G. E. I., 395.


83. We need not stay to ask whether the Srimadbhāgavat and
other Purānas can be trusted as evidence for the life of
Krishna; for all scholars agree that, while ancient Purānas
existed, all those that have come down to us reflect a later
stage of Hinduism than that of the Mahābhārata; and that,
while they contain much that is old scattered up and down
their pages, the oldest fragments are of the same general date
as the Mahābhārata and Manu. Hopkins, R. I., 434-445;
Macdonell, 299-302; Dutt, C. A. I., I, 19; II, 211; Müller, A. S.
L., 61; Kaegi, 8, 105; Krishnacharitra, Chaps. XIV-XVI.

84. The study of Prof. Macdonell’s excellent manual ought surely


now to be made part of any Sanskrit course prescribed for a
University degree in India.

85. Bose, H. C., Vol. I, 5.

86. The Student’s Chronicle, May 1903, p. 6.

87. For some amusing instances see Hopkins, R. I., 522, note, and
cf. Monier-Williams, Chap. X.

88. Monier-Williams, 260.

89. Garbe, 85; Monier-Williams, 98, 112, note.

90. McCrindle, Ancient India, 201. Cf. Hopkins, R. I., 459;


Macdonell, 411; Dutt, C. A. I., Vol. I, 219; Garbe, 19, 83.

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.

Let us accompany you on the journey of exploring knowledge and


personal growth!

ebookname.com

You might also like