Question: Why is [UserProfile sharedInstance].lastName null? Shouldn't it also it be "Smith"?
Because it has never been set to anything.
This:
UserProfile *profileSharedInstance = [Profile sharedInstance];
profileSharedInstance = [responseObject firstObject];
gets a reference to the singleton, and then replaces that reference with a new object. So, you don't really have a singleton instance (you are alloc init
ing another instance to return in responseObject
).
Instead of changing the object that profileSharedInstance
points to, you should be updating the values that it contains. Something like:
UserProfile *profileSharedInstance = [Profile sharedInstance];
profileSharedInstance.lastName = [responseObject firstObject].lastName;
(this isn't ideal, or efficient, but it should work)