Copy-pasting Adium code into an ARC project is not generally going to work...
On Sep 8, 2012, at 10:54 AM, "Evan D. Schoenberg, M.D." <e...@adium.im> wrote: > Bob, > > Everything looks right from here to me (except, of course, the problem > itself). Could you please post your project folder so far (to me privately > off-list if you would prefer not to share it publicly)? There must be > something subtly wrong - I'd like to figure out what it is directly and > update the docs to account for it. Most of our docs were written before > Xcode 4 and there may be some necessary change. > > -Evan > On Friday, September 7, 2012 at 11:52 PM, Bob Tanner wrote: > >> Followed http://trac.adium.im/wiki/CreatingPlugins to get a bare bones >> plugin compiled. >> >> >> >> Looking at "Plugins (Built In)/Services" for what to do next I created a >> obj-c class (posted at the end) but Xcode is giving me warnings and errors. >> >> >> >> NetrekAdiumPlugin/NetrekAdiumPlugin/AINetrekService.m:47:30: Implicit >> declaration of function 'AILocalizedString' is invalid in C99 >> >> NetrekAdiumPlugin/NetrekAdiumPlugin/AINetrekService.m:47:30: Implicit >> conversion of 'int' to 'NSString *' is disallowed with ARC / >> >> NetrekAdiumPlugin/NetrekAdiumPlugin/AINetrekService.m:47:30: Incompatible >> integer to pointer conversion sending 'int' to parameter of type 'NSString >> *'; >> >> NetrekAdiumPlugin/NetrekAdiumPlugin/AINetrekService.m:51:12: Implicit >> conversion of 'int' to 'NSString *' is disallowed with ARC >> >> >> >> I found AILocalizedString is a macro defoined in >> "AIUtilities/AIStringUtilities.h: but #import that file does not make the >> implicit declarations go away. >> >> >> >> Since I cut-n-pasted the code from the Bonjour plugin I'm not sure what I >> did wrong. New to obj-c, very new to Xcode, but have done a significant >> about of development in C, C++, and Python. >> >> >> >> Any help would be appreciated. Thanks. >> >> >> >> >> >> >> >> >> >> // >> >> // AINetrekService.h >> >> // >> >> #import <Adium/AIService.h> >> >> >> >> @interface AINetrekService : AIService { >> >> >> >> } >> >> >> >> @end >> >> >> >> // >> >> // AINetrekService.m >> >> // >> >> #import "AINetrekService.h" >> >> #import <Adium/AIStatusControllerProtocol.h> >> >> #import "AINetrekAccount.h" >> >> #import "AINetrekAccountViewController.h" >> >> >> >> @implementation AINetrekService >> >> >> >> //Account Creation >> >> - (Class)accountClass{ >> >> return [AINetrekAccount class]; >> >> } >> >> >> >> - (AIAccountViewController *)accountViewController{ >> >> return [AINetrekAccountViewController accountViewController]; >> >> } >> >> >> >> - (DCJoinChatViewController *)joinChatView{ >> >> return nil; >> >> } >> >> >> >> //Service Description >> >> - (NSString *)serviceCodeUniqueID{ >> >> return @"Netrek"; >> >> } >> >> - (NSString *)serviceID{ >> >> return @"Netrek"; >> >> } >> >> - (NSString *)serviceClass{ >> >> return @"Netrek"; >> >> } >> >> - (NSString *)shortDescription{ >> >> return @"Netrek"; >> >> } >> >> - (NSString *)longDescription{ >> >> return @"Netrek"; >> >> } >> >> - (NSURL *)serviceAccountSetupURL >> >> { >> >> return [NSURL >> URLWithString:AILocalizedString(@"http://en.wikipedia.org/wiki/Bonjour_(software)", >> @"URL for Bonjour signup or about page. Replace with the URL to an >> equivalent page in your language if one exists.")]; >> >> } >> >> - (NSString *)accountSetupLabel >> >> { >> >> return AILocalizedString(@"About Bonjour", @"Text for Bonjour sign up >> button"); >> >> } >> >> - (NSCharacterSet *)allowedCharacters{ >> >> return [[NSCharacterSet illegalCharacterSet] invertedSet]; >> >> } >> >> - (NSUInteger)allowedLength{ >> >> return 999; >> >> } >> >> - (BOOL)caseSensitive{ >> >> return YES; >> >> } >> >> - (AIServiceImportance)serviceImportance{ >> >> return AIServiceSecondary; >> >> } >> >> - (BOOL)supportsProxySettings{ >> >> return NO; >> >> } >> >> //No need for a password for Bonjour accounts >> >> - (BOOL)supportsPassword >> >> { >> >> return NO; >> >> } >> >> - (void)registerStatuses{ >> >> [adium.statusController registerStatus:STATUS_NAME_AVAILABLE >> >> withDescription:[adium.statusController >> localizedDescriptionForCoreStatusName:STATUS_NAME_AVAILABLE] >> >> ofType:AIAvailableStatusType >> >> forService:self]; >> >> >> [adium.statusController registerStatus:STATUS_NAME_AWAY >> >> withDescription:[adium.statusController >> localizedDescriptionForCoreStatusName:STATUS_NAME_AWAY] >> >> ofType:AIAwayStatusType >> >> forService:self]; >> >> } >> >> - (NSString *)defaultUserName { >> >> return NSFullUserName(); >> >> } >> >> >> >> @end >> >> >> >> -- >> >> Bob Tanner <tan...@real-time.com> | Phone : (952 943-8700 >> >> http://www.real-time.com, Linux, OSX, VMware | Fax : (952)943-8500 >> >> Key fingerprint = F785 DDFC CF94 7CE8 AA87 3A9D 3895 26F1 0DDB E378 >> >