Update foundation.cs

NSError should be an out parameter here.