What happens when you try to launch a null object in the c target?


I've got the following code:

[application.tripHandler createTrip:picker.date
                          pickUpAddress:[ModelUtil addresFragmentFromGeoAddress:pickUpAddress]
                      andDropOffAddress:[ModelUtil addresFragmentFromGeoAddress:dropOffAddress]
                      orDropOffLocation:dropOffFavorite forDriver:application.currentDriver.driverId
                             completion:^(NSObject *entity)
             Trip *createdTrip = (Trip *)entity;

What happens when entity is null?

If entity is nil, then createdTrip will be nil as well.

(nil and NULL are technically the same thing, but nil is semantically the null object value whereas NULL is the null pointer).

Casting a pointer does not actually do anything at runtime. It merely modifies the type being pointed-to, which then affects subsequent operations on the resulting value. But the actual pointer value will remain the same through the cast.