Is that the entire source for ViewController? If so, I don't see where you created the address book instance.
In general, if you send a message to something and nothing happens, you should check to see that "something" isn't nil. In your java days, you would have seen an NPE. In this language, nothing happens. 'myBook' is probably nil here.
Something like this in viewDidLoad
should do:
myBook = [[AddressBook alloc] initWithName:@"Some Name"];
manpreet
Best Answer
2 years ago
xCode iOS not registering:
Having some difficulty calling a get method (name), for a string, within an Object(addressCard) at a particular index(int index), within an NSMutableArray(book), within an object(addressBook).
Basically an iOS viewController has its own instance of an addressBook that holds addressCards within an NSMutableArray it instantiates. However in the viewLoad of the viewController, the AddressBook however doesn't get the card.
Is there some particular form for syntax in this particular case?
Fairly new to iOS, because its an app there are several files, but the main issue is directly related to addressBook.m's addCard and getCard Methods. Project is based on a lesson in learning Objective-C by Kochan if anyone is familiar with it (or can recommend a better source for learning iOS).