Discussion Forums  >  Xcode, Errors, Installing, Configuring

Replies: 13    Views: 140

trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
12/20/12 06:43 PM (13 years ago)

use of undeclared identifier socialise

While following the Socialize tutorial on how to set up Socialize in one's app. I encountered this error: use of undeclared identifier socialise When adding this code: #pragma mark - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions:(NSDictionary*)launchOptions { // set the socialize api key and secret, register your app here: http://www.getsocialize.com/apps/ [Socialize storeConsumerKey:@"SOCIALIZE_CONSUMER_KEY"]; [Socialize storeConsumerSecret:@"SOCIALIZE_CONSUMER_SECRET"]; //your application specific code return YES; } I noticed that this: - (BOOL)application:(UIApplication*)application didFinishLaunchingWithOptions: was already in appDelegate.m. I get this error : 77:1: Duplicate declaration of method 'application:didFinishLaunchingWithOptions:' I have a screen shot @ https://dl.dropbox.com/u/5618927/socialize1.jpg Any ideas? Thank you, Bruce
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
12/20/12 11:03 PM (13 years ago)
Judging from the screenshot and the error message, it looks like you forgot to import socialize - just add this - #import <Socialize/Socialize.h> - right below #import "Flurry.h" And yes, you aren't supposed to paste the "didFinishLaunchingWithOptions" part because it's already there. For example - in that screenshot you should delete everything from line 55-69. In my experience, pretty much no code should ever come before the "didFinishLaunchingWithOptions" method (aside from #import, synthesize, etc.) So, after deleting those lines just paste the necessary code from flurry and socialize right at the beginning of the method. It should look something like this -- -(BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions{ //socialize keys [Socialize storeConsumerKey:@"YOUR_SOCIALIZE_KEY"]; [Socialize storeConsumerSecret:@"YOUR_CONSUMER_KEY"]; [Flurry startSession:@"YOUR_FLURRY_KEY"];
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
12/21/12 04:58 PM (13 years ago)
Thank you for the help! I changed those setting but now I've got a host of other problems. I have a screen shot @ https://dl.dropbox.com/u/5618927/socialize2.jpg https://dl.dropbox.com/u/5618927/socialize3.jpg https://dl.dropbox.com/u/5618927/socialize4.jpg It might just be an errant symbol but I don't know code. Thanks, Bruce
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
12/21/12 05:20 PM (13 years ago)
Ok, I took some risk and deleted a few of these: { and got rid of most of the errors. Now I have just these left: https://dl.dropbox.com/u/5618927/socialize5.jpg thanks b
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
12/21/12 05:33 PM (13 years ago)
In this picture - https://dl.dropbox.com/u/5618927/socialize2.jpg - delete lines 71-77 A lot of tutorials put those lines of code in simply as a reference to where you you should put the other code. You aren't actually supposed to paste it in. They're basically telling you "find the didFinishLaunchingWithOptions method and paste our code inside of it" You don't need to know how to code to use buzztouch (I sure don't) but one vital thing you should know that will help you spot a lot of errors is that every open bracket needs to have a closed bracket to end it. I would probably do a horrible job of explaining it, but there are a ton of beginner programming guides on the internet that will explain further if you're interested so anyway, yeah, like I said...delete lines 71-77 and we'll see how it goes from there
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
12/21/12 05:42 PM (13 years ago)
I cleaned everything up and here's the error's I have left: https://dl.dropbox.com/u/5618927/socialize6.jpg b
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
12/21/12 06:41 PM (13 years ago)
haha ok we're gonna get this - in that last pic you linked to, delete everything from lines 55-63 also, not sure if this will do anything, but change the semi-colon(;) after "(BOOL)application" on line 64 to a regular colon(:) finally, delete the closing bracket on line 71
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
12/21/12 07:49 PM (13 years ago)
Did that and changed the ; to : Here's what I got: https://dl.dropbox.com/u/5618927/socialize7.jpg Down at the very end after deleting the closed bracket on line 71 I got: Parse issue Missing '@end"
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
12/22/12 02:06 PM (13 years ago)
ok, first of all the beginning of line 56 in that screenshot looks like this - "-[(BOOL)application:]" when it should look like this - "-(BOOL)application:" - so basically just get rid of ALL square brackets on line 56 (leave the curly bracket on the end) as far as the rest of the errors, it's hard to say because I can't see all of the code. I'm assuming it has to do with the fact that you said you "took some risk and deleted a few of these: {". If you can remember where you deleted those, you probably need to add them back
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
12/26/12 01:03 PM (13 years ago)
I can start from scratch no problem. Thank you
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
12/26/12 01:19 PM (13 years ago)
That worked for getting rid of those errors. Now I've got errors where I pasted the next code, in the BT_viewController.m file. https://dl.dropbox.com/u/5618927/socialize8.jpg
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
12/26/12 04:44 PM (13 years ago)
I started from scratch. I have no errors in the appdelegate file. I removed the @end (because there were 2) from the BT_viewController.m file. Now I just have the "missing context for method declaration" like the socialize8.jpg file shows. Can't compile because of this error.
 
trailman
Aspiring developer
Profile
Posts: 280
Reg: Dec 10, 2010
Sedona, az
6,550
like
12/27/12 12:34 PM (13 years ago)
Got it all figured out and running. Working on the tutorial now. Thanks for all the help... b
 
Absentia
buzztouch Evangelist
Profile
Posts: 960
Reg: Oct 20, 2011
Alaska
20,600
like
12/27/12 05:17 PM (13 years ago)
Awesome! Keep posting if you run into any more problems - happy to help
 

Login + Screen Name Required to Post

pointerLogin to participate so you can start earning points. Once you're logged in (and have a screen name entered in your profile), you can subscribe to topics, follow users, and start learning how to make apps like the pros.