Download full Objective C for Absolute Beginners iPhone iPad and Mac Programming Made Easy 3rd edition Edition Gary Bennett ebook all chapters
Download full Objective C for Absolute Beginners iPhone iPad and Mac Programming Made Easy 3rd edition Edition Gary Bennett ebook all chapters
https://ebookfinal.com/download/swift-2-for-absolute-beginners-2nd-
edition-gary-bennett/
https://ebookfinal.com/download/mac-programming-for-absolute-
beginners-1st-edition-wallace-wang/
https://ebookfinal.com/download/iphone-and-ipad-apps-for-absolute-
beginners-1st-edition-dr-rory-lewis-auth/
https://ebookfinal.com/download/swift-3-for-absolute-beginners-3rd-ed-
edition-bennett/
Head first iPhone and iPad development a learner s guide
to creating objective C applications for the iPhone and
iPad 2nd ed Edition Dan Pilone
https://ebookfinal.com/download/head-first-iphone-and-ipad-
development-a-learner-s-guide-to-creating-objective-c-applications-
for-the-iphone-and-ipad-2nd-ed-edition-dan-pilone/
https://ebookfinal.com/download/swift-game-programming-for-absolute-
beginners-1st-edition-arjan-egges/
https://ebookfinal.com/download/ios-5-programming-cookbook-solutions-
examples-for-iphone-ipad-and-ipod-touch-apps-1st-edition-vandad-
nahavandipoor/
https://ebookfinal.com/download/programming-ios-4-fundamentals-of-
iphone-ipad-and-ipod-touch-development-1st-edition-matt-neuburg/
Objective C for Absolute Beginners iPhone iPad and Mac
Programming Made Easy 3rd edition Edition Gary
Bennett Digital Instant Download
Author(s): Gary Bennett
ISBN(s): 9781484219041, 148421904X
Edition: 3rd edition
File Details: PDF, 20.81 MB
Year: 2016
Language: english
Objective-C for
Absolute Beginners
iPhone, iPad and Mac Programming
Made Easy
—
Third Edition
—
Gary Bennett
Brad Lees
Mitchell Fisher
Objective-C for Absolute
Beginners
iPhone, iPad and Mac Programming
Made Easy
Third Edition
Gary Bennett
Brad Lees
Mitchell Fisher
Objective-C for Absolute Beginners: iPhone, iPad and Mac Programming Made Easy
Gary Bennett Brad Lees
Scottsdale, Arizona, USA Phoenix, Arizona, USA
Mitchell Fisher
Boston, Massachusetts, USA
ISBN-13 (pbk): 978-1-4842-1903-4 ISBN-13 (electronic): 978-1-4842-1904-1
DOI 10.1007/978-1-4842-1904-1
Library of Congress Control Number: 2016960200
Copyright © 2016 by Gary Bennett, Brad Lees and Mitchell Fisher
This work is subject to copyright. All rights are reserved by the Publisher, whether the whole or part of the
material is concerned, specifically the rights of translation, reprinting, reuse of illustrations, recitation,
broadcasting, reproduction on microfilms or in any other physical way, and transmission or information storage
and retrieval, electronic adaptation, computer software, or by similar or dissimilar methodology now known or
hereafter developed.
Trademarked names, logos, and images may appear in this book. Rather than use a trademark symbol with
every occurrence of a trademarked name, logo, or image we use the names, logos, and images only in an
editorial fashion and to the benefit of the trademark owner, with no intention of infringement of the trademark.
The use in this publication of trade names, trademarks, service marks, and similar terms, even if they are
not identified as such, is not to be taken as an expression of opinion as to whether or not they are subject to
proprietary rights.
While the advice and information in this book are believed to be true and accurate at the date of publication,
neither the authors nor the editors nor the publisher can accept any legal responsibility for any errors or
omissions that may be made. The publisher makes no warranty, express or implied, with respect to the material
contained herein.
Managing Director: Welmoed Spahr
Lead Editor: Aaron Black
Technical Reviewer: Stefan Kaczmarek
Editorial Board: Steve Anglin, Pramila Balan, Laura Berendson, Aaron Black, Louise Corrigan,
Jonathan Gennick, Robert Hutchinson, Celestin Suresh John, Nikhil Karkal, James Markham,
Susan McDermott, Matthew Moodie, Natalie Pao, Gwenan Spearing
Coordinating Editor: Jessica Vakili
Copy Editor: Kim Wimpsett
Compositor: SPi Global
Indexer: SPi Global
Artist: SPi Global
Distributed to the book trade worldwide by Springer Science+Business Media New York,
233 Spring Street, 6th Floor, New York, NY 10013. Phone 1-800-SPRINGER, fax (201) 348-4505, e-mail
orders-ny@springer-sbm.com, or visit www.springeronline.com. Apress Media, LLC is a California LLC
and the sole member (owner) is Springer Science + Business Media Finance Inc (SSBM Finance Inc).
SSBM Finance Inc is a Delaware corporation.
For information on translations, please e-mail rights@apress.com, or visit www.apress.com.
Apress and friends of ED books may be purchased in bulk for academic, corporate, or promotional use. eBook
versions and licenses are also available for most titles. For more information, reference our Special Bulk
Sales–eBook Licensing web page at www.apress.com/bulk-sales.
Any source code or other supplementary materials referenced by the author in this text are available to
readers at www.apress.com. For detailed information about how to locate your book’s source code, go to
www.apress.com/source-code/. Readers can also access source code at SpringerLink in the Supplementary
Material section for each chapter.
Printed on acid-free paper
Gary would like to dedicate this book to his wife, Stefanie, and children,
Michael, Danielle, Michelle, and Emily, for always supporting him.
Mitch would like to dedicate this book to his family that supported him
through all the long nights, especially his wife Heather,
and his children, Jade, Eric, and Matthew
Contents at a Glance
v
Contents
vii
■ CONTENTS
Summary ........................................................................................................................ 33
Exercises ........................................................................................................................ 33
■Chapter 3: It’s All About the Data ........................................................................ 35
Numbering Systems Used in Programming ................................................................... 35
Bits ....................................................................................................................................................... 35
Bytes..................................................................................................................................................... 37
Hexadecimal ......................................................................................................................................... 39
Unicode................................................................................................................................................. 40
Designing Apps............................................................................................................... 63
Pseudo-code......................................................................................................................................... 63
Design Requirements ........................................................................................................................... 65
Flowcharting ......................................................................................................................................... 68
Designing and Flowcharting an Example App ...................................................................................... 69
The App’s Design .................................................................................................................................. 70
Using Loops to Repeat Program Statements ........................................................................................ 72
viii
■ CONTENTS
Inheritance ..................................................................................................................... 96
Why Use OOP? ................................................................................................................ 97
It Is Everywhere .................................................................................................................................... 97
Eliminate Redundant Code ................................................................................................................... 97
Ease of Debugging................................................................................................................................ 97
Ease of Replacement ............................................................................................................................ 98
Summary ........................................................................................................................ 98
Exercises ........................................................................................................................ 99
■Chapter 6: Learning Objective-C and Xcode ...................................................... 101
A Brief History of Objective-C ....................................................................................... 101
Understanding the Language Symbols and Basic Syntax ............................................ 102
Create a Variable ................................................................................................................................ 102
Begin and End a Section of Code ....................................................................................................... 102
Signify the End of a Line of Code........................................................................................................ 103
ix
■ CONTENTS
x
■ CONTENTS
xi
■ CONTENTS
xii
■ CONTENTS
xiii
About the Authors
xv
■ ABOUT THE AUTHORS
xvi
About the Technical Reviewer
xvii
Introduction
Over the past seven years, we’ve heard this countless times: “I’ve never programmed before, but I have a
great idea for an iPhone/iPad app. Can I really learn to program the iPhone or iPad?” We always answer,
“Yes, but you have to believe you can.” Only you are going to tell yourself you can’t do it.
xix
■ INTRODUCTION
Carnegie Mellon University received a grant from the U.S. government and developed Alice. Alice is an
innovative 3D programming environment that makes it easy to create rich graphical applications for new
developers. Alice is a teaching tool for students learning to program in an OOP environment. It uses 3D graphics
and a drag-and-drop interface to facilitate a more engaging, less frustrating first programming experience.
Alice enables you to focus on learning the principles of OOP without having to focus on learning a
complex IDE and Objective-C principles all at once. You get to focus on each topic individually. This helps
readers feel a real sense of accomplishment as they progress.
Alice removes all the complexity of learning an IDE and programming language syntax. It is drag-and-drop
programming. You’ll see it is actually fun to do, and you can develop really cool and sophisticated apps in Alice.
After the OOP topic has been introduced and you feel comfortable with the material, we then move into
Xcode, where you will get to use your new OOP knowledge in writing Objective-C applications. This enables
you to focus on the Objective-C syntax and language without having to learn OOP at the same time.
xx
■ INTRODUCTION
Dual Monitors
It is highly recommended that developers have a second monitor connected to their computer. It is great
to step through your code and watch your output window and iPad simulator at the same time on dual,
independent monitors. Apple hardware makes this easy. Note it is not required to have dual monitors; you
will just have to organize your open windows to fit on your screen if you don’t.
To access the dual-monitor set up feature, go to Apple System Preferences and select Displays
(see Figure I-1).
xxi
■ INTRODUCTION
Book Forum
We have developed an online forum for this book at http://forum.xcelme.com, where you can ask us
questions while you are learning Objective-C. See Figure I-2.
xxii
■ INTRODUCTION
Figure I-2. Reader forum for accessing answers to exercise and posting questions for authors
xxiii
CHAPTER 1
Now that you’re ready to become a software developer and have read the introduction of this book, you
need to become familiar with several key concepts. Your computer program will do exactly what you tell it
to do—no more and no less. It will follow the programming rules that were defined by the operating system
and programming language. Your program doesn’t care if you are having a bad day or how many times you
ask it to perform something. Often, what you think you’ve told your program to do and what it actually does
are two different things.
■ Key to Success If you haven’t already, take a few minutes to read the introduction of this book. The
introduction shows you where to go to access the free webinars, forums, and YouTube videos that go with each
chapter. Also, you’ll better understand why we are using the Alice programming environment and how to be
successful in developing your iOS and Mac apps.
Depending on your background, working with something absolutely black and white may be
frustrating. Many times, programming students have lamented, “That’s not what I wanted it to do!” As you
begin to gain experience and confidence programming, you’ll begin to think like a programmer. You will
understand software design and logic, and you will experience having your programs perform exactly as you
want and the satisfaction associated with this.
■ Note If you take anything away from this chapter, take away the importance of considering design
requirements and user interface design before starting software development. This is the most effective (and least
expensive) use of time in the software development cycle. Using a pencil and eraser is a lot easier and faster than
making changes to code because you didn’t have others look at the designs before starting to program.
Another key ingredient to your successful app is the user interface (UI) design. Apple recommends you spend
more than 50 percent of the entire development process focusing on the UI design. The design can be done
using simple pencil and paper or using Xcode’s storyboard feature to lay out your screen elements. Many
software developers start with the UI design, and after laying out all the screen elements and having many
users look at paper mock-ups, they then write the design requirements from their screen layouts.
After you have done your best to flesh out all the design requirements, laid out all the user interface
screens, and had the client(s) or potential customers look at your design and give you feedback, coding can
begin. Once coding begins, design requirements and user interface screens can change, but the changes are
typically minor and easily accommodated by the development process. See Figures 1-1 and 1-2.
Figure 1-1 shows a mock-up of a mobile banking app screen prior to development using OmniGraffle.
Developing mock-up screens along with design requirements forces developers to think through many of
the applications usability issues before coding begins. This enables the application development time to be
shortened and makes for a better user experience and better reviews on the App Store. Figure 1-2 shows how
the view for the mobile banking app actually appears when completed.
2
CHAPTER 1 ■ BECOMING A GREAT IOS OR MAC PROGRAMMER
Figure 1-1. This is a UI mock-up of the account balance screen for an iPhone mobile banking app before
development begins on the original iPhone in 2010. This UI design mock-up was completed using OmniGraffle
3
CHAPTER 1 ■ BECOMING A GREAT IOS OR MAC PROGRAMMER
Figure 1-2. This is a completed iPhone mobile banking application as it appeared on the App Store after
several revisions in 2015. This app is called Woodforest Mobile Banking
■ Note When an application is ready to be submitted to the App Store, Xcode gives the file an .app or .ipa
extension, for example, appName.app. That is why iPhone, iPad, and Mac applications are called apps. This
book uses program, application, and app to mean the same thing.
During the testing phase, the developer will need to work with QA staff to determine why the
application is not working as designed. The process is called debugging. It requires the developer to step
through the program to find out why the application is not working as designed. Figure 1-3 shows the
complete software development cycle.
4
CHAPTER 1 ■ BECOMING A GREAT IOS OR MAC PROGRAMMER
Frequently during testing and debugging, changes to the requirements (design) must occur to make
the application more usable for the customer. After the design requirements and user interface changes are
made, the process begins over again.
At some point, the application that everyone has been working so hard on must be shipped to the App
Store. Many considerations are taken into account when this happens.
• Cost of development
• Budget
• Stability of the application
• Return on investment
There is always the give-and-take between developers and management. Developers want the app
perfect and management wants to start realizing revenue from the investment as soon as possible. If the
release date were left up to the developers, the app would likely never ship to the App Store. Developers
would continue to tweak the app forever, making it faster, more efficient, and more usable. At some point,
however, the code needs to be pried from the developers’ hands and uploaded to the App Store so it can do
what it was meant to do.
Figure 1-4. There are three objects in this Alice application : UFO, Rover, and Alien. The UFO object can have
actions applied—takeoff and landing, turn right and turn left
Alice will run a program, such as the one shown in Figure 1-4, for you if you click the play button. When
you run your Alice applications, the user can apply actions to the objects in your application. Similarly,
Xcode is an integrated development environment (IDE) that enables you to run your application from
within your programming environment. You can test your applications on your computers first before
running them on your iOS devices by running the apps in Xcode’s iPhone simulator, as shown in Figure 1-5.
6
CHAPTER 1 ■ BECOMING A GREAT IOS OR MAC PROGRAMMER
Figure 1-5. This sample iPhone app contains a table object to organize a list of courses. Actions such as “rotate
left” or “user did select row 3” can be applied to this view object
Actions that are performed on objects are called methods. Methods manipulate objects to accomplish
what you want your app to do. For example, for a jet object, you might have the following methods:
goUp
goDown
bankLeft
turnOnAfterburners
lowerLandingGear
The table object in Figure 1-5 is actually called UITableView when you use it in a program, and it could
have the following methods:
numberOfRowsInSection
cellForRowAtIndexPath
canEditRowAtIndexPath
commitEditingStyle
didSelectRowAtIndexPath
7
CHAPTER 1 ■ BECOMING A GREAT IOS OR MAC PROGRAMMER
Most objects have data that describes those objects. This data is defined as properties. Each property
describes the associated object in a specific way. For example, the jet object’s properties might be as follows:
altitude = 10,000 feet
heading = North
speed = 500 knots
pitch = 10 degrees
yaw = 20 degrees
latitude = 33.575776
longitude = -111.875766
For the UITableView object in Figure 1-5, the following might be the properties:
backGroundColor = Red
selectedRow = 3
animateView = No
An object’s properties can be changed at any time when your program is running, when the user
interacts with the app, or when the programmer designs the app to accomplish the design requirements.
The values stored in the properties of an object at a specific time are collectively called the state of an object.
8
CHAPTER 1 ■ BECOMING A GREAT IOS OR MAC PROGRAMMER
Technically speaking, Alice is not a true IDE like Xcode, but it is pretty close and much easier to learn
than Xcode. A true IDE combines code development, user interface layout, debugging tools, documentation,
and simulator/console launching for a single application; see Figure 1-7. However, Alice offers a similar look,
feel, and features to Xcode. This will serve you well later when you start writing Objective-C code.
In the next chapter, you will go through the Alice interface and write your first program.
9
CHAPTER 1 ■ BECOMING A GREAT IOS OR MAC PROGRAMMER
Summary
Congratulations, you have finished the first chapter of this book. It is important that you have an
understanding of the following terms because they will be reinforced throughout this book:
• Computer program
• Algorithm
• Design requirements
• User interface
• Bug
• Quality assurance (QA)
• Debugging
• Object-oriented programming (OOP)
• Object
• Property
• Method
• State of an object
• Integrated development environment (IDE)
Exercises
• Answer the following questions:
• Why is it so important to spend time on your user requirements?
• What is the difference between design requirements and an algorithm?
• What is the difference between a method and a property?
• What is a bug?
• What is state?
• Write an algorithm for how a soda machine works from the time a coin is inserted
until a soda is dispensed. Assume the price of a soda is 80 cents.
• Write the design requirements for an app that will run the soda machine.
10
CHAPTER 2
Programming Basics
This chapter will focus on the building blocks that are necessary to become a great Objective-C programmer.
This chapter will go over how to use the Alice user interface, how to write your first Alice program, and how
to write your first Objective-C program; it will also explore some new OOP terms.
■ Note We want to introduce new concepts in Alice and later, in this chapter, enable you to use these
concepts in Objective-C. We have used this approach for the last eight years and know, from personal
experience, that this approach helps you learn the concepts quickly, without discouragement, and gives you a
great foundation to build upon.
You can start with the blue sky and green grass template or pick another template with a different
background. Feel free to explore and have fun. This is where you will spend most of your time and write your
first Alice application.
The Alice user interface is set up to help you efficiently write your applications. The user interface is
similar in form and function to the Xcode IDE. You will now explore the major sections of Alice.
Navigation Menu
The Navigation menu, shown in Figure 2-2, enables you to open and close files, set your application
preferences, and view world statistics. You can also access example worlds and Alice Help from the
Navigation menu.
Figure 2-2. This shows the main sections of the Alice user interface. Take some time to explore the user
interface. You will see in this chapter how it compares with Xcode and how it will help you learn Objective-C
12
CHAPTER 2 ■ PROGRAMMING BASICS
■ Note It is important that you save your program frequently when using Alice. If Alice crashes and
you haven’t saved your work, you will lose all your code or changes since you last saved. Additionally, we
recommend that you close Alice completely and reopen it when you want to open a new Alice program.
Editing a Scene
One of the most important Alice controls is the Setup Scene control. See Figure 2-3. When you click the Edit
Scene button, you launch Alice’s Scene Editor.
Figure 2-3. The Setup Scene button. This button will launch Alice’s Scene Editor and enable you to add objects
to your Alice world
It is important to learn how to move the camera around your world in order to get the view you want the
users to see.
By moving the camera around, you can provide the prospective you want with your app. See Figure 2-4.
13
CHAPTER 2 ■ PROGRAMMING BASICS
Figure 2-4. These are camera manipulation arrows to control the camera in the Edit Scene window
Take a minute to familiarize yourself with the Scene Editor shown in Figure 2-5. The Scene Editor
enables you to do the following:
• Add objects to your world from the gallery
• Add objects to your world from the Internet
• Position the objects in your world
• Adjust the camera for viewing your world
You will spend a lot of time adding objects and setting the camera in your worlds by using the Scene
Editor.
14
CHAPTER 2 ■ PROGRAMMING BASICS
boeing747
lockheedSR71
boeing737
citation10
f18Fighter
These objects are nearly identical. They are from the same Airplane class. They all have the same
following methods:
land()
takeOff()
lowerLandingGear()
raiseLandingGear()
bankRight()
bankLeft()
15
CHAPTER 2 ■ PROGRAMMING BASICS
The only thing that differentiates the objects is the values of their properties. Some of the properties of
the values might be as follows:
wingLength = 20ft
maxThrust = 200,000lbs
numberOfEngines = 2
In your world, you may have two objects that are exactly the same. You may want two Boeing 737s in
your view. Each copy of a class is called an instance. Adding an instance of a class to your program is called
instantiation.
Object Tree
The Object Tree (see Figure 2-6) enables you to view all the objects in your Alice world. Additionally, if the
object has subparts, you can view these subparts by clicking the plus sign, and you can collapse the subparts
by clicking the minus sign.
16
CHAPTER 2 ■ PROGRAMMING BASICS
Many of the Alice worlds come with several built-in objects that you will need for your apps. The world
in Figure 2-5 comes with the Camera and g round objects.
Editor Area
The Editor Area, the largest area of the Alice interface, is where you write your code. With Alice, you don’t
have to actually type code; you can drag and drop your code to manipulate your objects and properties. See
Figure 2-2.
■ Note Don’t forget the bottom of the Editor Area. The bottom contains a row of control and logic tiles for
looping, branching, and other logical structures that you can use to control the behavior of your objects.
Details Area
The Details Area of the Alice interface contains the tabs for properties, procedures, and functions that make
up the object that is selected in the Object Tree. See Figure 2-2.
• Properties contain the specific information of your selected object (e.g., weight,
length, and height).
• Procedures (methods and functions) perform actions upon the object (e.g., takeoff
and land).
• Functions and methods are similar. In Alice, the difference between the two is that a
method does not return a value. A function will return a value.
Events Area
The Events Area of the Alice interface contains a listing of all the existing events used by your app and
provides you with the opportunity to create new events. Events are conditions that trigger your methods.
Methods (or procedures) that react to these events are called event handlers. When a specific event occurs,
it triggers a signal that the event handler receives and handles.
17
CHAPTER 2 ■ PROGRAMMING BASICS
Alice really makes apps like this easy and fun to do. Make sure you follow these steps:
1. Click File and then New.
2. Click the Blank Slates tab.
3. Choose the Moon project, and click the OK button. See Figure 2-7.
4. Now, you need to add your objects. Click Setup Scene. It was the important
button in the World window shown in Figure 2-3.
5. In the Object Gallery, select the UFO Class from Tansport > Aircraft classes.
6. Left-click UFO to view some of the information about the object. See Figure 2-8.
You can click OK to add your objects to your world, or you can drag and drop
them from the gallery to the world.
■ Note You can see in this example why an instance is a copy of an object. You are making a copy of the
object and putting it in your world. Instantiation is a big word for the process of making a copy of and initializing
your object.
18
CHAPTER 2 ■ PROGRAMMING BASICS
Figure 2-8. Viewing and adding objects to your world from step 6
7. Add two Aliens from the Biped classes to your world. See Figure 2-9.
19
CHAPTER 2 ■ PROGRAMMING BASICS
8. Use the Camera Adjustment and Objects Adjustment tools, outlined in boxes in
Figure 2-10, to achieve the look and perspective you desire.
■ Tip Sometimes when you add two objects, Alice places one object over the other. Drag the top Alien to the
side of the other Alien if this occurs. Your world should look like Figure 2-10.
20
Exploring the Variety of Random
Documents with Different Content
especially offensive to their persecutor were strangled. Others
managed to eke out a wretched subsistence by the most menial
occupations, and even by beggary. The venerable Moshafi, after
suffering for years every humiliation that could be imposed by the
ingenuity of hatred and the insolence of power, perished in some
unknown way by violence, and his body was carried to the grave
with but little more ceremony than usually attended the interment of
a pauper.
While these events were transpiring, a formidable conspiracy for
the assassination of the Khalif and the promotion of one of his
cousins, Abd-al-Rahman-Ibn-Obeydallah, to the royal dignity, was
maturing in the capital. The great majority of the literary men,—the
former companions and instructors of Ibn-abi-Amir,—with officials
who had viewed his elevation with unconcealed envy and hatred,
stimulated by mediocrity and conscious incompetence, were the
promoters of the enterprise. The dangerous position of leader was
assumed by the eunuch Djaudar, who was anxious to avenge his
disgrace, to retrieve his fortunes, and to restore the failing credit of
his caste. There was scarcely a kadi, a jurist, a poet of the court, or a
professor of the University who was not cognizant of the plot. The
faquis and the theologians, who considered the orthodoxy of Ibn-abi-
Amir as more than doubtful, were concerned in it to a man. The
prefect, Ziyad-Ibn-Aflah, who had succeeded Ibn-abi-Amir in the
control of the municipal affairs of Cordova, promised his co-
operation, and agreed to place the armed force under his command
at the disposal of the conspirators. It was decided that Djaudar
should put the Khalif to death. The day for action arrived; the palace
was designedly abandoned by the police; and Djaudar obtained
without suspicion an audience with Hischem. But, either through
awkwardness or irresolution, the blow aimed at the heart of the
Khalif fell short; the assassin was overpowered; and the prefect,
having been summoned to the palace and seeing that all was lost,
endeavored to remove suspicion from himself by the arrest and
zealous prosecution of his accomplices. The leading conspirators
were crucified, and punishments of greater or less severity were
inflicted upon the others. The double traitor, Ziyad-Ibn-Aflah, with
brazen effrontery, assisted at the trial and voted for the
condemnation of his former associates.
Aware that his liberal views on the subject of religion, and the
philosophical studies with which he frequently occupied his leisure,
had created against him a feeling which was largely responsible for
the recent conspiracy, and which might eventually be productive of
more serious disorders, Ibn-abi-Amir determined to make some
concessions to the prejudices of the theologians. The broad
toleration of the two former reigns, when skepticism was fashionable
and the cultivation of philosophy general and popular, had been
followed by a reaction. The influence of the Malikites had been re-
established, and it was easy for these fanatics to excite popular
odium against any one suspected of entertaining heretical opinions.
When the obnoxious individual filled a post of eminence in the state,
a hint from a faqui might be equivalent to a sentence of death. The
native shrewdness of Ibn-abi-Amir suggested a means of
counteracting this danger. Having carefully selected the theologians
of the capital most notorious for their intolerance, he invited them to
the palace and solemnly informed them that the presence of the
philosophical and scientific works in the library of Al-Hakem was a
great burden upon his conscience, and requested their assistance in
purging the collection of books treating of subjects whose study was
not sanctioned by the Koran. Conducted into the immense library
whose shelves were covered with the literary treasures of Europe
and Asia, the bigoted enemies of learning entered upon their task
with alacrity. The collection was examined in detail, and the works
known or suspected to be tainted with heterodox sentiments were
consigned to the flames. The distinguished penitent improved the
occasion to offer an edifying exhibition of zeal by personally assisting
in the destruction of the proscribed volumes.
History has failed to acquaint us with the magnitude of this loss. It
must have been important, however, even if due allowance be made
for the ignorance of the muftis and faquis, who had but slight
knowledge of any save theological literature, and whose industry
must have been sorely taxed by the laborious scrutiny of six hundred
thousand volumes. Henceforth no one ventured to question the
orthodoxy of the minister. He patronized with marked partiality all
members of the religious profession; flattered their pride by his
attention to their prosy discourses; won their affection by his
liberality; elicited their praise by his denunciation of infidels. He
demonstrated that the skill of his youth had not departed from him by
the production of a beautiful copy of the Koran, written entirely by his
own hand, which he never suffered to leave his person, and
constantly perused in public with such apparent unction that all who
beheld him were greatly impressed with this remarkable display of
devotion.
Moshafi having been disposed of, it was now the turn of Ghalib.
The powerful interest of Ibn-abi-Amir with the Sultana and the nobles
which had raised him to the rank of hajib placed him on a political
equality with his father-in-law. The latter was constantly at variance
with his associate, whom he considered as his inferior, but whose
ascendency in the conduct of the administration he was nevertheless
forced to acknowledge. The annoyance Ibn-abi-Amir suffered from
these disputes, and the fact that Ghalib was now the sole obstacle
interposed between his ambition and the practical sovereignty of the
empire, led him to begin without delay the scheme which he had
devised for the overthrow of his colleague. The first, and indeed the
indispensable, requisite of success was the control of the army. The
power of the audacious minister, which was dreaded by every civil
functionary of the khalifate, virtually ended at the outposts of the
nearest garrison. The soldiery knew him only as a kadi; and while he
had behaved with credit in more than one engagement, and had
established a name for generosity, his military reputation and
popularity had so far proved to be neither brilliant nor enduring. The
attachment of the soldiers centred in Ghalib. They had shared
together the hardships and the glory of many arduous campaigns.
Their interests had long been identical, and any demonstration
involving the honor or the safety of the general would have been
resisted by the entire military force of the monarchy. The army
consisted mainly of Arabs, the Berbers enlisted by Abd-al-Rahman
III. having been gradually disbanded and natives of the Peninsula
substituted for them under Al-Hakem. The partiality of their
commander had indulged them in frequent and serious infractions of
discipline. Their equipment was not uniform, and was often
defective. The awkwardness of the horsemen was the jest of
foreigners. In many respects the organization of the various corps
did not differ from that of a disorderly and inefficient militia.
The experience acquired by Ibn-abi-Amir during his sojourn in
Africa had convinced him of the excellence of the Mauritanian
cavalry, whose reputation indeed dated from the First Punic War.
The Spanish posts in that country had been abandoned, with the
exception of Ceuta, and the protectorate formerly exercised by the
khalif removed. In consequence of this measure, and there being no
central power to restrain the Berbers, the entire region became at
once a prey to anarchy. At the time the minister was planning a
thorough reorganization of the army, intelligence was conveyed to
him by the governor of Ceuta that a considerable detachment of
Berbers, who had been worsted in a recent battle and were
absolutely impoverished, had appealed to him for protection, which
he had temporarily afforded them. The pleasure of the government
was requested respecting the final disposition of these refugees. The
order was immediately sent to propose to them enlistment in the
army of the khalifate. The offer was accepted without hesitation, and
the inhabitants of Algeziras beheld with consternation and disgust
the disembarkation of a horde of ferocious warriors clothed in rags
and mounted on horses whose skeleton forms seemed hardly
capable of sustaining even the weight of their emaciated riders. But
the sagacious hajib, who recognized in these uncouth barbarians the
formidable instruments of a soaring ambition, entertained his new
protégés with royal hospitality. The finest arms and horses were
furnished them. Their boundless rapacity was gratified by every
concession that insolence could demand or prodigality afford. The
famished bandit, who had lately roamed the desert without shelter,
now revelled in the luxuries of a palace. The servile dependent who
a few months before had trembled at the voice of some vagabond
sheik was now the master of a hundred slaves. The news of this
astonishing good fortune was speedily transmitted to Africa.
Thousands of volunteers applied for admission to the service of so
generous a patron. The object of Ibn-abi-Amir was accomplished,
and with secret exultation he saw placed at his absolute disposal a
powerful body of troops, whose allegiance was due to himself alone,
who knew and cared nothing for patriotic sentiment, and who were
practically isolated from the existing military system. His efforts,
however, were not confined to the enlistment of Berber mercenaries.
From the opposite quarter of the compass, from a region and a
nation where one would least suspect a disposition to serve under
the banners of Islam, his army received important accessions. It
does not appear that before the reign of Hischem any systematic
attempt was made to attract to the service of the khalifate the
Christians of the North, whose hostility to their neighbors was
hereditary and instinctive, dictated as well by motives of patriotism
as by the prejudices and the distorted maxims of their religion. The
civil wars of fifty years; the uncertain allegiance claimed by a
succession of known usurpers and legal sovereigns of suspicious
title; the arrogance of the priesthood, which claimed ascendency
over the crown, had destroyed the unity and absorbed the limited
pecuniary resources of the kingdoms of Northern Spain. The
population had increased, while the means of subsistence had been
constantly diminishing. The insecurity of property discouraged
agriculture in a land where untiring industry was at all times
indispensable to procure the most common necessaries of life. The
country was overrun by armed men, who did not hesitate, when
occasion demanded, to rudely strip the unfortunate peasant of the
hard-earned fruits of his labor. The lofty stature and extraordinary
strength of these mountaineers, their unequalled powers of
endurance, their bravery and their steadiness in battle, rendered
them most desirable recruits. The emissaries of Ibn-abi-Amir
experienced no difficulty in convincing them of the benefits they
would receive by a change of masters. A considerable detachment
repaired to Cordova and entered the army of the Khalif. The minister
treated them with even greater indulgence than he had shown to the
Africans. They received double pay. They were lodged in palatial
quarters. They were magnificently armed and mounted, and
provided with every attainable comfort and luxury. The partiality of
the hajib for these favorite mercenaries sometimes even caused him
to depart from the equity which had heretofore characterized his
judicial conduct. In the controversies he was called upon, from time
to time, to settle between his Moslem subjects and his Christian
guards, his decisions were almost invariably rendered in favor of the
latter. The effects of this politic course soon became apparent. The
Castilians and Navarrese, like the Berbers, volunteered in larger
numbers than could be accommodated. Only picked men were
accepted by the recruiting officers; and a corps was formed which,
for physical strength, perfection of armament, and excellence of
discipline, had not its counterpart in Europe.
While Ibn-abi-Amir was thus, day by day, tightening his grasp
upon the civil and military departments of the government, he was, at
the same time, gradually undermining the support and weakening
the power of his rival. The custom of tribal organization, inherited
from the pre-Islamic era, still prevailed in the army. Members of the
same tribe, commanded by chiefs of their own kindred, were
mustered into the service together. In numerous instances, by
intermarriage with individuals of other races, the chain of relationship
had been broken. Clannish prejudice had, however, survived the
record of genealogies, for many were found enrolled among the
various tribes who evidently had not the remotest claim to such
association. The policy of Ibn-abi-Amir was directed to the final
abrogation of these ancient distinctions. The Arabs were distributed
among the strongest divisions of the Berber and Christian
mercenaries. By this means their identity was lost amidst a crowd of
foreigners ignorant alike of their customs, their traditions, and, not
infrequently, of their language. The favorite troops of Ghalib were, by
this means, quietly and expeditiously scattered beyond the hope of
reorganization. The discipline of the army was sedulously improved.
Officers were appointed to command whose first qualification was
devotion to the personal interests of the hajib, and whose second
was based upon their experience in war and their reputation for
courage. Military regulations were enforced with such severity that
even the accidental exposure of a sword during parade was
punished with death.
Having to his entire satisfaction obtained control of the army, Ibn-
abi-Amir now proposed to himself the audacious project of placing
and retaining the youthful Khalif in a condition of perpetual tutelage.
His mother, over whom the minister still retained his ascendency,
strange to relate, willingly lent her aid to the accomplishment of this
nefarious design. The talents of the young prince, at that time about
fifteen years old, are stated by contemporaneous writers to have
been far above mediocrity. Under favorable circumstances, it is
possible that he might have become a ruler not inferior to the most
distinguished of his line. But, unhappily, every effort was exerted to
dwarf his intellect and impair his physical powers. He was kept in
strict seclusion in the palace of Medina-al-Zahrâ. His teachers were
removed, and his education systematically neglected. It was
constantly inculcated upon him that his chief duties as a monarch
were the diligent perusal of the Koran and the distribution of alms.
His body was emaciated, and his intellectual faculties weakened, by
the frequent and protracted fasts which his religious advisers
enjoined. These regulations, sufficiently injurious to both the body
and the mind of youth, were not to be compared in their destructive
effects with the sensual excesses encouraged by the temptations of
the harem. In its retired and mysterious apartments everything was
favorable to the precocious development of the passions. Crowds of
beautiful slaves constantly surrounded him, and performed for his
amusement the licentious dances of the East. The rarest perfumes
diffused their intoxicating odors through the dimly-lighted
apartments. Here, safe from the frowning glances of faqui and
santon, could be quaffed, to the point of repletion and insensibility,
the delicious wines of Spain. The attendants received peremptory
instructions to lose no opportunity of corrupting and brutalizing their
helpless charge. In consequence, the unfortunate Hischem was
degraded by the habitual practice of the most revolting vices. His
prematurely failing powers were at first stimulated by aphrodisiacs.
His virility was afterwards permanently impaired by drugs
administered for that purpose by eunuchs in the pay of the minister.
With the advance of the prince in years, the conditions and
diversions of childhood remained unchanged. The same toys
amused his idle moments. The same devotional exercises were daily
enforced by his spiritual guides. His world was bounded by the walls
of the palace, within which no one unauthorized by the hajib could
enter. Alert and observant spies reported his most trivial speeches,
his most puerile actions. It was gravely suggested to him that the
burden of public affairs was too weighty for his shoulders; that the
favor of God—the object of every true Mussulman—was most easily
secured by devotional exercises; and that the administration of the
government should be confided to others who could assume the
responsibilities, without compromising the future hopes, of the
Commander of the Faithful. The Khalif’s voluntary acceptance of
these propositions—and especially of the last one—was proclaimed
far and wide by the omnipresent agents of the hajib. But the latter,
despite his apparent assurance, knew only too well the desperate
game he was playing. He was familiar with the uncertainty of popular
favor and the prodigious energy suddenly developed by revolutions.
His secret enemies, many of them able and determined men,
swarmed alike in the literary professions and among the populace of
the capital. The isolation of the Khalif was complete, but the
treachery of a sentinel or the venality of a slave might, at any time,
mature a conspiracy or effect the liberation of the royal prisoner. In
either of these contingencies, the life of the minister would not be
worth a moment’s purchase were he found within the walls of
Medina-al-Zahrâ. Impressed with this fact, he secured a large estate
east of Cordova, and erected there a residence which united the
twofold advantage of castle and palace, and to which he gave the
name of Zahira. The place was of great strength, and could
accommodate a numerous garrison. When it was completed, Ibn-
abi-Amir removed there all the public records, and in its halls were
henceforth framed the edicts which, issued in the Khalif’s name,
gave law to the people of the Peninsula. Buildings were erected for
the convenience of the great officials of the government, and Zahira
soon acquired the inhabitants and assumed the appearance of a city.
The employees of the court, the personal adherents of the minister,
and the herd of parasites who infested the purlieus of every palace,
together with a multitude of tradesmen and artificers, took up their
residence in the neighborhood; and an idea may be formed of the
extent of Zahira when it is remembered that, although the residence
of Ibn-abi-Amir was twelve miles from Cordova, the gardens of its
environs reached to the banks of the Guadalquivir immediately
opposite the capital, of which it, in fact, formed one of the most
attractive suburbs.
Of this villa a story is told by the Arab historians which illustrates
at once the wealth, the profusion, and the love of ostentation so
prominent in the character of the Oriental. With a view of impressing
the envoys of the King of Navarre with his power and opulence, the
hajib ordered a great lake in the gardens of Zahira to be planted with
water-lilies. Into each of the flowers, during the night, he caused to
be placed a gold or silver coin, large numbers of which he had
ordered struck especially for that purpose. The weight of the
precious metals required was two hundred pounds. At the audience,
which took place at sunrise, in addition to the grand civil and military
display usual on such occasions, a body of eunuchs, a thousand in
number and equally divided, stood on each side of the throne. All
were dressed in white silk. The robes of five hundred were
embroidered with gold, those of the others with silver. Sashes of gold
or silver tissue encircled their waists, and each carried a gold or
silver tray. As the first rays of the sun lighted up the splendors of the
scene, the eunuchs moved forward with military precision, gathered
the lilies, and emptied their precious contents at the feet of their
master in a great heap of glittering coin. The effect of this exhibition
upon the simple mountaineers of Navarre may be imagined. The
reputation of the hajib’s resources, already great, was magnified a
hundred-fold. Mystified by the apparent prodigy, the ambassadors
reported to their king that even the earth and the water surrendered
their hidden treasures at the command of the omnipotent
Mohammedan ruler.
While the astute and politic Ibn-abi-Amir was perfecting his
arrangements to secure absolute control of the empire, he treated
Ghalib with far more than ordinary consideration. He exhibited
towards him, on all occasions, the most distinguished courtesy. He
deferred to his opinion on questions of minor importance. He humbly
solicited his advice when satisfied that its acceptance would not
interfere with the accomplishment of his plans. But the shrewd old
soldier was not to be imposed upon by those flattering evidences of
esteem and attachment. Intensely loyal to the House of Ommeyah,
he had seen with disgust and apprehension the restraint of the Khalif
and the usurpation of his prerogatives. He had viewed with scarcely
less dismay the inordinate ambition of his colleague and the
predominance to which he had attained.
While he did not at first perceive the ultimate effect of the
reorganization of the military service, the disbanding and transfer to
distant and widely separated provinces of those divisions most
attached to his person, as well as the incorporation of his favorites
into the corps of foreign mercenaries, finally opened his eyes to the
consequences of the policy of his son-in-law. But it was then too late.
The mischief had already been accomplished. The indignation of the
general at first found vent in ineffectual reproaches. At length, during
an expedition into the enemy’s country, while the two ministers were
reconnoitering from the summit of a tower, after a violent quarrel
Ghalib drew his sword and attacked his associate. The latter, taken
by surprise, saw no other way to avoid instant death but by
precipitating himself from the battlements. His flowing robes caught
on a projection and saved his life. The incensed rivals separated with
threats of mutual defiance; war was at once declared between them;
and the diminished forces of Ghalib were strengthened by a
considerable number of horsemen furnished by the King of Leon.
The operations of the campaign were at first indecisive, but Ghalib,
having exposed himself recklessly in an engagement, was killed; his
followers were seized with a panic, and the victory remained with his
fortunate adversary.
Ibn-abi-Amir was now the sole master of the Khalifate of the West.
By sheer force of character, by dauntless resolution, by tireless
energy, he had realized his most cherished aspirations. Without
friends or the important aid of family connections, he had obtained
and had already long exercised a preponderating influence in the
state. His adroitness and liberality had organized a numerous faction
and a formidable army, both of which served his personal interests
with unswerving loyalty. The nominal sovereign of the country was
virtually his servant. The entire machinery of government, with its
treasures, the appointments of its officers, the distribution of its
rewards, the infliction of its punishments, the supervision of its civil
policy, the conduct of its campaigns, was in his hands. Such was the
exalted position attained by the former unknown and impecunious
student of the University, who had managed to obtain an uncertain
livelihood by writing petitions for applicants for royal favor, many of
whom were now his official subordinates. Through the changes of
many eventful years, amidst the perils, the trials, the excitements,
the triumphs, that attended his ascent to greatness, he had never
forgotten the scene in the garden, where, encouraged by the hilarity
of his companions, he had expressed what they considered
chimerical ideas of future power and distinction. Soon after the death
of Ghalib had left him free to indulge his arbitrary inclinations, he
caused his four collegiate acquaintances, who had participated in the
festivities of that now memorable occasion, to be brought before him.
Three received from the hands of the minister himself the
commissions conferring those employments which they had in
merriment solicited; the fourth, after having been sternly
reprimanded for the unprovoked insult he had inflicted in return for a
proffered honor, was deprived of all his possessions, and led forth by
slaves to perform the public and degrading penance which he
himself had voluntarily prescribed.
The restraints imposed upon Hischem were now increased in
severity. Formerly he had, at rare intervals, been permitted to show
himself to his subjects, but the jealousy of Ibn-abi-Amir could no
longer tolerate this indulgence, and the Khalif was henceforth
condemned to absolute seclusion in the palace of Medina-al-Zahrâ.
Even when he performed his devotions in public he was heavily
veiled, and remained in the royal gallery until the last of the
worshippers had left the mosque. He was not even permitted to
enter the walls of his own capital, embellished with the wealth, and
rendered illustrious by the renown, of a dynasty of great sovereigns
who had been his kinsmen, whose name and titles he had inherited,
but whose power he was destined never to enjoy. His name was
mentioned in the khotba, or prayer, offered on Fridays in the
mosques; it appeared on the coins side by side with that of the hajib,
and was embroidered on the skirt of his robes; but these were the
only surviving evidences of the existence and the authority of the last
of the Ommeyades.
In the new and radical policy which Ibn-abi-Amir had inaugurated
with respect to the army, he was far from being actuated by purely
selfish motives. He understood thoroughly the inconstant and
restless nature of the population which he ruled. Experience had
repeatedly shown the perilous conditions arising from a protracted
peace. The Koran enjoined perpetual war against the infidel. Such a
crusade was popular with all classes,—with the theologians, whose
religious animosities it gratified; with the merchants, whose trade it
increased and whose coffers it replenished; with the nobility, to
whom it opened an avenue to military distinction; with the soldiery,
who were attracted by the prospect of unlimited plunder. Every year,
from the date of his association with Ghalib in the administration,
Ibn-abi-Amir had proclaimed the Djihad, and had himself taken part
in two expeditions against the Christians. To this policy, whose
expediency was indisputable, he publicly declared his intention to
adhere. The people heard the announcement with exultation. The
faquis applauded the piety of the hajib with a fervor which they
scarcely vouchsafed to the deeds of the saints who filled the Moslem
calendar. The constant employment of a large number of troops in
hostile operations was a substantial guaranty against revolution.
With this potent safeguard, the dangers of sedition were no longer to
be apprehended. The passions and the energy of the nation were to
be expended in a war beyond the borders of the monarchy. But still
another consideration influenced the mind of the great statesman.
He was zealously solicitous for the honor, profoundly ambitious for
the glory, of his country. He desired to extend her frontiers; to
recover the territory that had been conquered from or basely yielded
by her sovereigns, as well as to chastise her blaspheming enemies.
Of the greater number of the fifty-two campaigns directed by Ibn-
abi-Amir, the chroniclers of the time have left us no record. Many of
them, doubtless, were mere marauding expeditions; but all were
uniformly and signally successful. Not the slightest reverse dimmed
the lustre of a single triumph. With each year the limits of the
Christian kingdoms became more and more contracted, until they
barely reached the southern slopes of the mountains. Beyond,
stretching away to the Moslem border, was a scene of desolation,
where once waving crops and verdant pastures met the eye. The
presence of an occasional pile of blackened ruins was the only
indication that the country had ever been inhabited. So complete
was this devastation that the plains of Leon and Castile have not yet
recovered from its effects. The forests then cut down have never
been replanted. The curse of sterility, and the freezing winds that
sweep over this cheerless region, seem to discourage the hope that
it will ever regain its former productiveness. The incessant march of
the Moorish armies for a quarter of a century obliterated every sign
of animal and vegetable life.
The ire of Ibn-abi-Amir was aroused by the reflection that the King
of Leon, despite the admonitions he had received, had dared to
assist his rival Moshafi, and, bent on revenge, he made preparations
for the most important expedition which had under his command
ever invaded the Christian territory. The strong city of Zamora,
defended by seven mighty walls and seven moats, was taken by
storm. Four thousand of the enemy were butchered, and as many
more led into captivity. A thousand settlements, surrounded by
evidences of the thrift of an industrious peasantry, were given to the
flames. A considerable number of monasteries and convents were
destroyed, and their inmates delivered to the Berbers to be insulted
and tortured with every device of ruthless barbarity. Realizing their
common danger, the Kings of Leon and Navarre formed a defensive
alliance with the Count of Castile, and ventured to resist the progress
of the Moslems. The hostile armies met at Rueda, not far from
Simancas. A great battle took place; the Christians were completely
routed, and victors and vanquished entered Simancas together. No
quarter was shown by the infuriated Saracens. Every Christian who
fell into their power was put to the sword. Winter was at hand, but
Ibn-abi-Amir, who understood the necessity of following up a victory,
without heeding cold or tempest, moved on Leon. The city, reduced
to extremity, was about to yield, when the intolerable hardships of
the season, which was one of unusual severity, compelled a retreat.
After the capture of Simancas, the enthusiastic soldiery conferred
upon their commander the appelation of Al-Mansur, The Victorious.
This name, by which the hajib was afterwards universally
designated, was, in imitation of the custom of the khalifs, accepted
by him as a title of honor. With its adoption he arrogated to himself
many other tokens of distinction hitherto considered the exclusive
privileges of royalty. His titles were woven in golden letters on the
hem of his garments. His name was associated with that of Hischem
in the khotba. Of all who approached him the most servile obeisance
was exacted. New and oppressive regulations were added to the
already complicated ceremonial of the court. The marks and
requirements of homage extended to every member of the hajib’s
family, even to infants in the cradle. None of the monarchs who
inherited the sceptre of Moorish Spain had ever enforced rules of
this kind with equal severity, or had environed their persons with
such a net-work of formal and frivolous etiquette. While the neglect
of these ceremonies was followed by exemplary punishment, the
least disparagement of the motives or the conduct of the minister
was a mortal offence. Giafar, Prince of Zab, who commanded the
first troop of Berbers enlisted in the service of Al-Mansur, actuated
by envy, permitted himself to publicly criticise the policy of the hajib.
The latter smiled but said nothing when the offensive language of the
Mauritanian chieftain, whom he had loaded with favors, was reported
to him. A magnificent banquet was soon afterwards given at Zahira,
where Giafar was distinguished by the favor and courtesy of Al-
Mansur above all who were present. The precepts of the law were
ignored in these festivities; the richest wines flowed in profusion; and
Giafar, while he was being conducted to his residence in a state of
helpless intoxication, was waylaid and pierced with the daggers of
assassins employed for that purpose by the minister.
The kingdoms of Christian Spain, none of which, in the tenth
century, could aspire to the importance of a modern principality, and
which were always at variance with each other, habitually
disregarded the vital principle of unity that alone could insure their
preservation. A rivalry which, under the circumstances, was suicidal
flourished even in the presence of the Saracen armies. The mutual
hatred engendered by provincial prejudice was incredibly intense
and bitter. The pride of nationality, the spirit of patriotism, were
unknown. Each state labored to defeat the undertakings of the
others, no matter how meritorious was their object. The seal of the
Church was branded upon all laws and political institutions. The
predominating ecclesiastical element still enacted statutes, elected
kings, levied taxes, commanded armies. Leon was seriously
weakened by intestine quarrels. The nobles were constantly aspiring
to the throne, and raising up a succession of incompetent
pretenders. The powerful appanage of Castile had been permanently
alienated from the crown, and enjoyed a nominal independence
without the resources to maintain its lofty pretensions. Many of the
bravest warriors of the North had been tempted by promises of high
pay and abundant booty to renounce their allegiance, and were now
serving under the standard of the khalifate. With the successes of
the Moslems, and the diminution of their own territory, the mutual
distrust of the Christian princes increased, and their isolation from
each other became more and more complete. Their domestic feuds
and irreconcilable antipathies induced them, in turn, to solicit the aid
of their natural enemies, a measure which led to the imposition of
tribute and the acknowledgment of vassalage. The city of Cordova
was filled with Christian exiles, who continually importuned the
government to embrace the cause of their several factions against
their kindred and their countrymen. Some of the most serious and
fatal revolutions which disturbed the peace of the northern states
were traceable to this source, and to the intrigues of proscribed
adventurers whose designs it was manifestly the interest of the
Moslems to promote. The difficulties which beset the youth and
inexperience of Ramiro III., King of Leon, caused him to appeal to
the court of Cordova for support against the usurper Bermudo, who
had deprived him of his capital and his crown. In return for the
desired assistance, the dethroned King announced his willingness to
become the feudatory of the Khalif. Before the treaty was concluded,
however, Ramiro died. The partisans of the latter were numerous
and powerful; the color of right as well as superiority of title would
invest any candidate whom they might select; and Bermudo
determined to anticipate their designs, follow the unworthy example
of his deceased rival, and, by the sacrifice of his personal honor and
the independence of his country, retain a portion of the authority he
had illegally acquired. The humiliating concessions demanded by Al-
Mansur were acquiesced in without hesitation by the cowardly
usurper; homage was rendered to the hajib as suzerain; and,
menaced by the presence of a Moslem army, the kingdom of Leon,
every foot of which had been won from the infidels at an immense
sacrifice of life and valor, for the third time since its conquest by the
Asturians descended to the position of a tributary principality.
Having reduced the kingdoms of the North to such a condition of
helplessness that he had nothing to fear from their hostility, Al-
Mansur now directed his attention towards a country which had long
enjoyed immunity from Moslem invasion. The County of Catalonia,
while a nominal appanage of France, was ruled by its chief
magistrate with all the attributes of despotic sovereignty. The
weakness or the apprehensions of former khalifs had deterred them
from provoking a contest which might bring upon them, in addition to
their domestic foes, the united forces of the French monarchy. These
fears, however, were ill founded. The provinces of that kingdom, like
those of Christian Spain, were a prey to internal discord. The society
of France was in a state of transition. A bitter contest was raging
between feudal pretensions and royal prerogative. The crown had no
resources to squander in the defence of a distant and unprofitable
dependency, and the haughty nobles would have resisted an attempt
to levy troops for a campaign of doubtful issue beyond the Pyrenees.
All these facts were known to Al-Mansur, whose spies infested every
court in Europe. His resolution formed, the minister caused the Holy
War to be proclaimed against the Catalans. It was the twenty-third
expedition of his reign. Elated by the hope of fresh victories,
volunteers responded by thousands. A great army was mustered,
which was met on the frontier by the Catalan troops commanded by
Count Borel in person. An engagement took place, but the
Christians, long unaccustomed to war, could not stand before the
veterans of the khalifate. They were defeated with serious loss, and,
five days afterwards, Barcelona was stormed and delivered over to
pillage. Of the inhabitants few escaped death or captivity excepting
the Jews, those constant sympathizers with the Moslems, who, early
recognizing the advantageous situation of Barcelona, had settled
there in large numbers, had accumulated vast fortunes, had risen to
unrivalled eminence in the knowledge and practice of medicine, and
had founded commercial establishments whose interests were
protected and whose influence was acknowledged in every country
of the globe. The Count preserved the remainder of his dominions
from a similar fate by the payment of an immense ransom. This
dearly-purchased immunity proved the salvation of Eastern Spain,
which, unable to withstand the attacks of the Moslems, and entirely
without hope of foreign aid, must otherwise have been eventually
added to the realm of Islam.
Turning his piercing glance towards every point of the compass
where a victory could be gained or an enemy humiliated, Al-Mansur
now determined to interfere once more in the affairs of Africa. In that
country the partisans of the House of Ommeyah, after many
vicissitudes, had once more regained the ascendency. But scarcely
was this result accomplished, when Ibn-Kenun, the last prince of the
Edrisite dynasty, who, at his own request, had been sent to Tunis by
Al-Hakem, on condition that he would never again set foot on his
ancient domain, appeared to assert his claims as hereditary
sovereign of Mauritania. For ten years he had been the guest of the
Fatimite Khalif of Egypt, whose real or pretended descent from a
common ancestor afforded a specious pretext for granting the exile
protection. Overcome by his importunities, the Sultan had at length
consented to assist his troublesome kinsman to regain his throne.
Negotiations were entered into with the Berbers. The Egyptian
monarch furnished a considerable sum of money and a detachment
of soldiers, and Ibn-Kenun was received by his former subjects with
every manifestation of loyalty. The Ommeyade cause speedily
declined; its partisans were put to flight in repeated skirmishes; their
strongholds fell into the hands of the enemy, and the dreadful
prospect of African invasion once more confronted the inhabitants of
the Peninsula.
It was the intelligence of these disasters, received at Barcelona,
which, far more than the great ransom offered by Count Borel,
determined Al-Mansur to relinquish the conquest of Catalonia. A
division of the victorious army, commanded by Askaledja, cousin of
the hajib, disembarked at Ceuta before Ibn-Kenun knew that Al-
Mansur intended to oppose him. The Edrisite prince was beaten, and
surrendered under condition of a safe-conduct to Cordova, with
permission to make that city his future residence. But in the signing
of this convention the self-esteem of the Saracen general had
permitted him to exceed his authority. The dangerous character of
Ibn-Kenun, as well as considerations of public safety, demanded the
adoption of a less indulgent policy towards such an inveterate foe of
the khalifate. The agreement of Askaledja was repudiated by Al-
Mansur, and Ibn-Kenun, having been brought a prisoner to
Algeziras, was beheaded without ceremony. This flagrant disregard
of a solemn treaty, a deed which not only impugned the honor of the
hajib’s lieutenant but was branded as a horrible sacrilege, caused
great dissatisfaction throughout Andalusia. The victim was one of the
descendants of Ali, regarded by a numerous sect as the incarnation
of divinity, and revered by a majority of believers throughout the
Moslem world. The indignation of the populace found vent in
murmurs and menaces. Askaledja, infuriated beyond measure, went
so far as to denounce his superior to the troops under his command.
The maintenance of order and the requirements of discipline could
not tolerate such an exhibition of insubordination; and the imprudent
officer was promptly arrested for treason, found guilty, and executed.
This act of justice, although approved by the Divan, only aggravated
the popular resentment. The minister once more realized that the
empire he had secured by intrigue must be constantly sustained by
arms. It was necessary to divert the attention of the people from the
severe measures indispensable to domestic tranquillity to
meritorious schemes of foreign conquest. An opportune pretext for a
rupture with the King of Leon had recently presented itself. The
Moorish force, entertained by Bermudo under pretence of
maintaining his authority, but really to overawe the usurper and
enforce the payment of tribute, had signalized its residence among
the infidels by the perpetration of every kind of outrage. It was in vain
that Bermudo remonstrated; his complaints were received by the
government at Cordova with silent contempt. Then, adopting the only
cause possible under the circumstances, he appealed to the
patriotism of his subjects, assembled an army, and drove out the
obnoxious intruders. The pride of Al-Mansur could not afford to brook
such an insult. A strong body of Moslems attacked Coimbra, whose
remote situation and distance from the usual field of operations had
hitherto insured its safety. It was taken; its buildings were burned and
demolished; and for seven years afterwards the site of this once
flourishing city remained desolate and uninhabited. From Coimbra,
crossing the Douro, the hajib directed his course straight to the
enemy’s capital. Formerly, protected by its massive fortifications and
aided by a winter of unusual severity, the garrison had been able to
defy his efforts to take it by storm. Leon was the strongest and most
important fortress of the North. Its defences dated from the era of the
Roman domination. Its walls, built by the architects of the Cæsars,
measured more than twenty feet in thickness. Lofty towers, protected
by barbicans, rose at frequent intervals of their extensive circuit,
which enclosed houses massed together and constructed principally
of stone. The gates were bronze and of prodigious weight. They
were hung in portals faced with marble and decorated with carvings
and statues. The citadel was considered absolutely impregnable.
The garrison was numerous, experienced in military operations, and
provided with every requisite for a protracted defence.
But the city once invested, the impetuosity and resolution of the
Moslems disappointed the hopes of the besieged, who expected that
the reverse attending the former attack would be repeated. The
reputation of Al-Mansur was staked upon the issue. Able officers,
skilled in the use of military engines which had descended from
Rome and Byzantium, directed the approaches and superintended
the mining of the walls. The resistance was most obstinate, but, a
breach having finally been made, the veterans of Al-Mansur rushed
to the assault. The governor of the city, Count Gonzalez, whom
severe illness had rendered incapable of action, advised of the
progress of the enemy, ordered his attendants to arm him and carry
him to the front. The exhortations and the sight of its emaciated
commander animated the garrison to conspicuous but unavailing
deeds of valor. The front ranks of the Christians were broken, and
the Moslems poured into the breach. The governor, helpless and
bleeding, was killed in his litter at the head of his troops, as became
a gallant and intrepid soldier. Exasperated by the stubborn
resistance they had experienced, the Moslems gave no quarter. The
city, after having been plundered, was razed. The enormous strength
of its defences, the tenacity of the Roman masonry, constructed to
defy alike the slow action of the elements and the destructive efforts
of man, availed nothing against the systematic havoc of the
implacable Al-Mansur. A solitary tower was left standing as a
specimen of the dimensions of those fortifications which had been
levelled with the ground. A vast heap of stones and rubbish marked
the site of the Christian capital, where a populous town had existed
from the time of Augustus, when the camp of the Legio Septima
constituted an important frontier outpost of the Roman empire.
The Saracen army in its march to Leon had flanked Zamora,
where Bermudo had taken refuge. Al-Mansur, on his return,
prepared to besiege that city, and Bermudo took advantage of the
prevailing confusion to escape with the remnant of his followers to
Oviedo. Zamora surrendered, and was forthwith delivered up to the
caprices of the licentious soldiery. Deserted by their monarch, the
Leonese nobles hastened to make peace with the conqueror. Most
of them did homage to him for their estates. The remainder, who
declined to sacrifice the prejudices of a lifetime and disobey the
admonitions of the Church for the enjoyment of a temporary
advantage, were rewarded for their loyalty with oppression and
insult. The territory which remained under the control of Bermudo at
the end of this campaign was less in extent than that formerly
possessed by one of his inferior vassals.
The absence of Al-Mansur had been improved by the malcontents
who infested the capital in the formation of a plot which
contemplated the assassination of all of the principal officials of the
government, as well as the Khalif, and the partition of the states of
the monarchy. Abd-al-Rahman-Ibn-Motarrif, governor of the northern
frontier, was the originator of the conspiracy. Abdallah, the oldest son
of the minister, several princes of the blood holding important
commands, and a number of civil and military functionaries whose
positions of trust rendered their complicity the more formidable, were
implicated in it. The spies of Al-Mansur detected this treasonable
enterprise before it was fully matured. The latter, pursuing the course
he ordinarily adopted to disarm suspicion, at first treated the
conspirators with conspicuous marks of favor, and then secretly
invited complaints against them for other offences. Nothing was
insinuated of the existence of a plot or of prosecutions for treason.
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.
ebookfinal.com