Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.
Both are.

One might be easier or more flexible than the other in a given situation, but without knowing what your intention is, there's no way to say one is more proper.
 
From the NSAlert docs:
Note: The NSAlert class, which was introduced in Mac OS X v10.3, supersedes the functional Application Kit API for displaying alerts (NSRunAlertPanel, NSBeginAlertSheet, and so on). The former API is still supported, but you should use the NSAlert class for your application’s alert dialogs.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.