(no subject)
(no subject)
- Subject: (no subject)
- From: Stefan Fisk <email@hidden>
- Date: Mon, 21 Feb 2005 10:36:37 +0100
Hi!
I'm trying to simplify my -setDelegate: a bit, and therefore want to put all my notifications in a c-style array.
But, could anyone explain why the code snippet below gives me the following error:
<x-tad-smaller>
TNKCoreTask.m:18: error: (near initialization for `delegationNotifications[0]')
TNKCoreTask.m:18: error: initializer element is not constant
TNKCoreTask.m:19: error: (near initialization for `delegationNotifications[1]')
TNKCoreTask.m:19: error: initializer element is not constant
TNKCoreTask.m:21: error: (near initialization for `delegationNotifications[2]')
TNKCoreTask.m:21: error: initializer element is not constant
</x-tad-smaller>
I've tried googling for a couple of hours, but i found nothing that felt relevant.
My reason for doing it this way is that i want to standardize my -setDelegate: methods as far as possible, so that there's only place in the code to edit when adding notifications.
CODE:
NSString * const TNKCoreTaskDidLaunchNotification = @"coreTaskDidLaunch:";
NSString * const TNKCoreTaskDidWriteToStdOutNotification = @"coreTaskDidWriteToStdOut:";
NSString * const TNKCoreTaskDidTerminateNotification = @"coreTaskDidTerminate:";
NSString *delegationNotifications[] = {
TNKCoreTaskDidLaunchNotification,
TNKCoreTaskDidWriteToStdOutNotification,
TNKCoreTaskDidTerminateNotification,
nil
};
Thanks on forehand
Stefan Fisk _______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden