所以我有2個對象。copyWithZone被稱爲
Library.h:
NSString *name;
Book *book;
Book.h:
NSString *title
NSString *author;
的屬性都設置爲(讀寫,拷貝)
ViewController.h:
Library *library;
Book *book;
ViewController.m:
library = [[Library alloc] init];
book = [[Book alloc]init];
//The fallowing all works
library.name = @"Library Name";
book.title = @"book Title";
book.author = @"book author";
//The fallowing crashes my app
library.book = book;
我怎樣才能封裝圖書庫對象的內部?
調試器給我一個下面的錯誤。
[庫copyWithZone:]:無法識別選擇
這表示感謝。 – endy 2010-12-04 00:59:17