Article:
 |
|
Adding a Preferences Window to Your Application
|
| Subject: |
|
Avoid insertion of empty record |
| Date: |
|
2001-12-29 19:09:15 |
| From: |
|
michele
|
|
|
|
In order not to insert an empty record, I've inserted the following statements at the beginning of insertRecord:
// Check if the new record is not empty
if ( ([[firstNameField stringValue] isEqualToString: @""]) &&
([[lastNameField stringValue] isEqualToString: @""]) &&
([[emailField stringValue] isEqualToString: @""]) &&
([[homePhoneField stringValue] isEqualToString: @""]) &&
([[workPhoneField stringValue] isEqualToString: @""]) &&
([[mobilPhoneField stringValue] isEqualToString: @""]) )
{
return;
}
|
Showing messages 1 through 1 of 1.
-
Avoid insertion of empty record
2003-08-30 15:50:51
anonymous2
[View]
Besides, your logic is upside down. You are checking for what you DON'T want to find, instead of what you DO want to find.
Make your logid aright. THIMK a bit. ;P