Re: (no subject)
Re: (no subject)
- Subject: Re: (no subject)
- From: Darkshadow <email@hidden>
- Date: Mon, 21 Feb 2005 06:04:53 -0500
On Feb 21, 2005, at 4:36 AM, Stefan Fisk wrote:
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:";
Try const NSString *
NSString *delegationNotifications[] = {
TNKCoreTaskDidLaunchNotification,
TNKCoreTaskDidWriteToStdOutNotification,
TNKCoreTaskDidTerminateNotification,
nil
};
Thanks on forehand
Stefan Fisk
Attachment:
smime.p7s
Description: S/MIME cryptographic signature
_______________________________________________
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
References: | |
| >(no subject) (From: Stefan Fisk <email@hidden>) |