I am having this issue in Xcode 6. It is fine if I use this in Xcode 5 or below.
Objects are automatically instantiated even though it's nil
and can't check nil
.
NSString *userID = [DataManager sharedInstance].currentUser.userId;
if (!userID) {
userID = @"user";
}
[userInfo setObject:userID forKey:LogDataUserIDKey];
That's what I am doing and I am getting EXE_BAD_ACCESS(code=1, address=0x443b800c)
at the last line.
userID
is instantiated as my attached screenshot. How can I check whether userID
is nil. I am lost. Please advise.