[sword-svn] r3411 - trunk/bindings/objc/src

mdbergmann at crosswire.org mdbergmann at crosswire.org
Thu Feb 25 02:43:52 MST 2016


Author: mdbergmann
Date: 2016-02-25 02:43:52 -0700 (Thu, 25 Feb 2016)
New Revision: 3411

Modified:
   trunk/bindings/objc/src/SwordBible.h
   trunk/bindings/objc/src/SwordBible.mm
Log:
property simplifications.

Modified: trunk/bindings/objc/src/SwordBible.h
===================================================================
--- trunk/bindings/objc/src/SwordBible.h	2016-02-15 20:19:37 UTC (rev 3410)
+++ trunk/bindings/objc/src/SwordBible.h	2016-02-25 09:43:52 UTC (rev 3411)
@@ -25,11 +25,9 @@
 	NewTestament
 }Testament;
 
- at interface SwordBible : SwordModule {
-    NSMutableDictionary *books;
-}
+ at interface SwordBible : SwordModule
 
- at property (strong, readwrite) NSMutableDictionary *books;
+ at property (strong, readwrite) NSDictionary *books;
 
 // ----------- class methods -------------
 + (void)decodeRef:(NSString *)ref intoBook:(NSString **)bookName book:(int *)book chapter:(int *)chapter verse:(int *)verse;

Modified: trunk/bindings/objc/src/SwordBible.mm
===================================================================
--- trunk/bindings/objc/src/SwordBible.mm	2016-02-15 20:19:37 UTC (rev 3410)
+++ trunk/bindings/objc/src/SwordBible.mm	2016-02-25 09:43:52 UTC (rev 3411)
@@ -19,7 +19,7 @@
 
 @interface SwordBible ()
 
-- (void)buildBookList;
+- (NSDictionary *)buildBookList;
 - (BOOL)containsBookNumber:(int)aBookNum;
 - (NSArray *)textEntriesForReference:(NSString *)aReference context:(int)context textType:(TextPullType)textType;
 
@@ -123,7 +123,7 @@
 
 #pragma mark - Bible information
 
-- (void)buildBookList {
+- (NSDictionary *)buildBookList {
     sword::VersificationMgr *vmgr = sword::VersificationMgr::getSystemVersificationMgr();
     const sword::VersificationMgr::System *system = vmgr->getVersificationSystem([[self versification] UTF8String]);
 
@@ -138,7 +138,7 @@
         NSString *bookName = [bb name];
         buf[bookName] = bb;
     }
-    self.books = buf;
+    self.books = [NSDictionary dictionaryWithDictionary:buf];
 }
 
 - (BOOL)containsBookNumber:(int)aBookNum {
@@ -150,15 +150,15 @@
     return NO;
 }
 
-- (NSMutableDictionary *)books {
-    if(books == nil) {
+- (NSDictionary *)books {
+    if(self.books == nil) {
         [self buildBookList];
     }
-    return books;
+    return self.books;
 }
 
-- (void)setBooks:(NSMutableDictionary *)aBooks {
-    books = aBooks;
+- (void)setBooks:(NSDictionary *)aBooks {
+    self.books = aBooks;
 }
 
 - (NSArray *)bookList {




More information about the sword-cvs mailing list