Discussion Forums  >  Xcode, Errors, Installing, Configuring

Replies: 25    Views: 111

CampGirl
Lost but trying
Profile
Posts: 144
Reg: Jan 10, 2013
Here and Now
7,240
04/17/14 01:48 PM (10 years ago)

semantic and parse issues with flappy bird clone?

Hi, I'm getting semantic issues, saying "use of undeclared identifier app delegate": wth_appDelegate_appDelegate *appDelegate = (wth_appDelegate_appDelegate *)[[[UIApplication sharedApplication] delegate]; appDelegate.rootApp.currentScreenData = self.screenData; And parse errors, like "expected expression ]" with the Flappy Bird Clone game when I try to compile- BT control panel, using Xcode 5.1.1, deployment to iOS 7.1 Any thoughts? Thanks, Sarah
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
04/17/14 05:38 PM (10 years ago)
which clone is it? Mackimack's or MrDavid's? Try changing both instances of "wth_appDelegate" to "universal_appDelegate", that may work.Ive seen that somewhere, but dont remember where
 
Cakebit
Code is Art
Profile
Posts: 501
Reg: Dec 15, 2010
In your local b...
16,510
like
04/17/14 06:02 PM (10 years ago)
As I look at this code, I see that there are 3 opening brackets [[[ but only 2 closing ones ]]. Let's try this peice of code with only two opening brackets [[: wth_appDelegate_appDelegate *appDelegate = (wth_appDelegate_appDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.rootApp.currentScreenData = self.screenData;
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
04/17/14 06:04 PM (10 years ago)
Nice catch CakeBit! I would try CakeBit's solution first, before trying mine.
 
mrDavid
BTMods.com
Profile
Posts: 3936
Reg: May 21, 2011
San Diego, CA
51,910
like
04/17/14 06:08 PM (10 years ago)
Her app delegates are not declared, should not be a syntax or semantic issue. If your project is not named "wth" then you need to update the appdelegate references with YOURPROJECTNAME_appDelegate (whatever your project app is named), all three of them. Cheers, David https://www.btmods.com/chat/
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/17/14 06:30 PM (10 years ago)
Hey coffee, you seen universal_appdelegate in my files... Because my universal studios app project was named "Universal". ;) just thought I'd clarify in case anyone thought there might be some magical wild card available for delegate names. No such luck
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/17/14 06:47 PM (10 years ago)
First glance, I vote Cakebit's solution. Cheers! -- Smug
 
CMCOFFEE
Android Fan
Profile
Posts: 2017
Reg: Jan 04, 2013
Amarillo, Texas
26,670
like
04/17/14 07:58 PM (10 years ago)
Angry I think that is where I seen that lol.I remember trying that in one of my plugins, and wondering why it didn't work
 
CampGirl
Lost but trying
Profile
Posts: 144
Reg: Jan 10, 2013
Here and Now
7,240
like
04/18/14 08:44 AM (10 years ago)
Hi all, thanks for the help! Ok, I replaced the code with Cakebit's code, and still get "Missing [ at start" and "Use of undeclared identifier 'app delegate.'" The app is named wth, so I don't think that's the issue...
 
CampGirl
Lost but trying
Profile
Posts: 144
Reg: Jan 10, 2013
Here and Now
7,240
like
04/18/14 08:52 AM (10 years ago)
This is what it looks like now: [wth_appDelegate_appDelegate *appDelegate = (wth_appDelegate_appDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.rootApp.currentScreenData = self.screenData; Three semantic issues: Use of undeclared identifier 'with_appDelegate_appDelegate' Use of undeclared identifier 'appDelegate' Use of undeclared identifier 'appDelegate' and two parse issues: Expected expression Expected ']' to match this '[' Not sure where those expressions go, and why the appDelegate problems...
 
CampGirl
Lost but trying
Profile
Posts: 144
Reg: Jan 10, 2013
Here and Now
7,240
like
04/18/14 08:53 AM (10 years ago)
Oh, and it's Mackimack's flappy bird clone. =)
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/18/14 08:53 AM (10 years ago)
Hi CampGirl, Try redownloading your project and running again. Something may have gone awry during the download (rare, but it happens). What this will do is recreate any of the _appDelegate code that the plugin generates with your specific project name in place of the default BT placeholders in the file. Couldn't hurt, then we could eliminate that as any possible cause. Also, when running the new version, make sure to remove all data from your simulator and clean the project before running, to make sure we're not caching anything that could be causing the errors.
 
CampGirl
Lost but trying
Profile
Posts: 144
Reg: Jan 10, 2013
Here and Now
7,240
like
04/18/14 08:55 AM (10 years ago)
Will do, Angry- thanks.
 
SmugWimp
Smugger than thou...
Profile
Posts: 6316
Reg: Nov 07, 2012
Tamuning, GU
81,410
like
04/18/14 09:02 AM (10 years ago)
brackets in the wrong place. Should look more like this: wth_appDelegate_appDelegate *appDelegate = (wth_appDelegate_appDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.rootApp.currentScreenData = self.screenData; Cheers! -- Smug
 
CampGirl
Lost but trying
Profile
Posts: 144
Reg: Jan 10, 2013
Here and Now
7,240
like
04/18/14 09:06 AM (10 years ago)
Ok, I redownloaded and still get the same errors. The code looks like Smug has above. ??
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/18/14 09:07 AM (10 years ago)
If you want to email me the code, I can take a look at it. [email protected]
 
CampGirl
Lost but trying
Profile
Posts: 144
Reg: Jan 10, 2013
Here and Now
7,240
like
04/18/14 09:15 AM (10 years ago)
I've changed it and now have just 3 errors, and the code looks like this: wth_appDelegate_appDelegate *appDelegate = [(wth_appDelegate_appDelegate *)][[[UIApplication sharedApplication]delegate]]] appDelegate.rootApp.currentScreenData = self.screenData; The parse issue is at the right side parenthesis after the * The semantic issues are at the "wth" and at the "*appDelegate"
 
CampGirl
Lost but trying
Profile
Posts: 144
Reg: Jan 10, 2013
Here and Now
7,240
like
04/18/14 09:16 AM (10 years ago)
Should I still email you Angry?
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/18/14 09:17 AM (10 years ago)
If you want to, sure. I'll sniff around the error log and see if I can find the cause.
 
CampGirl
Lost but trying
Profile
Posts: 144
Reg: Jan 10, 2013
Here and Now
7,240
like
04/18/14 09:21 AM (10 years ago)
On it's way- thanks for your help!
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/18/14 09:30 AM (10 years ago)
Got it! ------------------ Replace This: ------------------ wth_appDelegate_appDelegate *appDelegate = [(wth_appDelegate_appDelegate *)][[[UIApplication sharedApplication]delegate]]] appDelegate.rootApp.currentScreenData = self.screenData; ------------------ With This: ------------------ wth_appDelegate *appDelegate = (wth_appDelegate *)[[UIApplication sharedApplication] delegate]; appDelegate.rootApp.currentScreenData = self.screenData; ------------------- I'm not sure of the cause, but the above code seems to have fixed it. I don't know if it's something specific to your project, or if it's something with the plugin files.
 
CampGirl
Lost but trying
Profile
Posts: 144
Reg: Jan 10, 2013
Here and Now
7,240
like
04/18/14 09:38 AM (10 years ago)
Yay!!! Thank you, it works!! So it was an extra appDelegate thing??
 
Angry Ninja
Aspiring developer
Profile
Posts: 1045
Reg: Aug 25, 2013
Maine
17,150
like
04/18/14 09:41 AM (10 years ago)
Awesome! Glad we got it working. Always happy to help. Yep, it was... no idea how it got put in there. I would think if the stock plugin files were setup like that MackiMack would have heard about it by now, but you never know. Easy to test if you create a blank project and just add a new flappy bird screen and execute it. If the new project does the same, you might want to send mackimack a PM and let him know about the bug.
 
CampGirl
Lost but trying
Profile
Posts: 144
Reg: Jan 10, 2013
Here and Now
7,240
like
04/18/14 09:52 AM (10 years ago)
Thanks, I will. I did just add the games to this app the other day. This app was my first BT app and is very simple, but was TOO simple for Apple (I was so proud of myself for learning how to create and submit an app!) so I added a couple more things to it. We'll see how it goes this time around!
 
KozmoWeb
Aspiring developer
Profile
Posts: 342
Reg: Dec 08, 2012
Sarasota, FL
8,520
like
05/07/14 05:44 PM (10 years ago)
Note that the Angry Ninja's fix posted above at 04/18/14 11:30 AM worked for me on this same error. Looks like the plugin creator needs to take a look at the code and provide an update (especially given this is looks like a easy fix and it is a paid plugin).
 
KozmoWeb
Aspiring developer
Profile
Posts: 342
Reg: Dec 08, 2012
Sarasota, FL
8,520
like
05/13/14 02:04 PM (10 years ago)
I messaged the plugin author 2 days ago and he provided an update to the plugin today! His notes look like it should have fixed this problem.
 

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.