在我的根視圖控制器(名爲rootViewController.h)後,我有一個屬性Objective C的屬性設置爲null使用
@property (nonatomic, strong) NSDictionary *contactList;
我試着去儲值本詞典。林傳遞的財產,以我的函數
AddContact *addContact = [[AddContact alloc]init];
NSString *result = @"";
result = [addContact addContact:user :[self contactList]];
當我去我的addContact功能和斷點時,contactList爲空,即使我使用這段代碼加5倍的contactList。
User *newUser = [[User alloc]init];
newUser.name = user.name;
newUser.phoneNumber = user.phoneNumber;
newUser.companyName = user.companyName;
[contactList setValue:newUser forKey:newUser.name];
幫助
[addContact addContact:user:[self contactList]]; 這個函數似乎沒有正確格式化,你可以粘貼函數定義行嗎? – Mortgy
添加了函數定義。 – EdBer
定義線如' - (void)addContact:(User *)user FromDicit:(NSDictionary *)dict;'你的定義是這樣嗎? – Mortgy