CS193P - Lecture 14
iPhone Application Development
Debugging Tips
CoreFoundation
Searching
Notifications
Announcements
•
Presence 3 was due last night at midnight
!
Ask if you’re not sure how many late days you’ve used
•
Presence 4 is out today, due Wednesday 11/12
•
Expect final project proposal feedback this week
!
Final projects due week of 12/5
Today’s Topics
•
Debugging Tips
•
CoreFoundation
•
Searching
•
Notifications
•
Tab Bar + Navigation Controllers (Review)
•
Presence 4
Debugging Tips
Messaging Nil
•
Remember, sending a message to nil is valid in Objective-C
!
Has no effect, returns nil/zero
!
Won’t crash, log or throw an exception
•
Very convenient, avoid repetitive checks
•
But it can be a source of subtle bugs
!
When debugging, ensure you’re not unexpectedly messaging nil
NSArray *array = nil;
// Forget to initialize array
[array addObject:someObject];
NSLog(@“%d”, [array count]); // Prints 0
// Spend 5 hours debugging and going crazy