iPhone : Problem while fetching the twits from twitter - iphone

In my iphone app, I am trying to fetch twits from twitter.
And I got one example coding from following link :
http://mobile.tutsplus.com/tutorials/iphone/iphone-json-twitter-api/
But when i implemented this example I got following warning:
Directory not found for option '-L/Volumes/MacShare/Ankit/Twitter Search/JSON/iphoneos.sdk/usr/local/lib'
What can be done?

I think you are forgetting the step of copying the JSON framework in your project -
# Drag the JSON folder from the DMG and drop it in your Xcode project. You can add it to the “Other Sources” group if you would like.
# Select the ‘Copy items into destination group’s folder’ option when prompted.
I just downloaded the code from http://mobiletuts.s3.amazonaws.com/14_iPhoneJSONFramework/JSONTwitterSearch.zip and its working great!!
follow the steps carefully!!
You can do one more thing.. download their source code and drag the Json folder from their project to your project..

Related

Setting up facebook login in swift

I have been trying to setup an facebook login in my app.
In the guide I'm following from facebook, it says I need to import this:
#import <FBSDKCoreKit/FBSDKCoreKit.h>
I have downloaded the IOS SDK folder which I took the Corekit folder and dragged it into my project in xcode, however when I create a objective c file and insert the line, it says:
"FBSDKCoreKit/FBSDKCoreKit.h file not found."
Did you check the "copy items if needed" checkbox ?
If you didn't you have to add framework search path in your project settings
First of all it is better to include header files to the bridging header and then use method by swift way (https://developer.apple.com/library/ios/documentation/Swift/Conceptual/BuildingCocoaApps/MixandMatch.html).
Then I would prefer to install FB through cocoapods.
If you insist on your solution then check Header Serch Paths in project > Build Settings > Search Paths > Header Search Paths.

Static Library path nightmare from hell

This is the point. I have a subproject (static library) created. The library compiles well. No errors. When I include this library inside a project and imports a header from that library on the project the library fails to compile because it cannot find a path that belongs to itself.
After following a bunch of tutorials on the web on how to create a static library and embed that in a project, I don't know which one is the correct one, because I have tried all and all failed and some differ.
This is how the library is set:
STATIC LIBRARY
BUILD SETTINGS:
Public header folder path = $(BUILT_PRODUCTS_DIR)
Header search path = $(SRCROOT) (recursive)
BUILD PHASES
COPY FILES = 1 file, myLibrary.h that is basically empty (created by xcode when I used the static library template to start the library.
no ADD COPY HEADERS phase
MAIN PROJECT
BUILD SETTINGS
Header search path = empty
User header search path = $(BUILT_PRODUCTS_DIR) (recursive)
Always search user paths = YES
BUILD PHASES
Yes, myLibrary.a is on target dependencies
What amazes me is that the library compiles fine alone but when put inside a project, is unable to find a header that belongs to the own library.
NOTE: I have also tried to create a copy headers phase on the library making public all .h on that library, but it failed too.
This is an example of one error:
/Users/mike/Library/Developer/Xcode/DerivedData/MyApp-dnaimaovscreasadhmvgttwjnabc/Build/Products/Debug-iphoneos/include/myLibrary/ccTypes.h:39:9:
fatal error: 'Platforms/CCGL.h' file not found
#import "Platforms/CCGL.h"
I have lost two days trying to solve this nightmare.
any thoughts?
I have uploaded a sample project to here and here
After downloading your sample project, I had it working in a few minutes by making the following changes.
First, you need to add an entry for the MyProject target's Build Settings under Header Search Paths, so that the files such as HelloWorldLayer.h, which #import "cocos2d.h", know where to find that file.
Under the Header Search Paths, I entered ../MyStaticLibrary/MyStaticLibrary/libs/** like shown in the image below:
That solved the problem of the inability of the preprocessor to find the necessary source files from the MyStaticLibrary, for the MyProject project, but after compiling, I got an error about missing symbols. I needed to add the built libMyStaticLibrary.a to the Link Binary With Libraries step like shown in the image below:
After that, the project compiles fine.
(Not enough rep to post comment...)
Did you try specifically including the Platforms directory in the header search path? Presumably, Platforms is in the source directory, not in $(BUILT_PRODUCTS_DIR) so may not be searched in your current setting.
Regarding script to show you env variables, here's how I do it (open images at the new tab for better scaling):
Added dummy shell script
Observed its output at Log Navigator
As you can see, BUILT_PRODUCTS_DIR doesn't have any headers copied from the library. Either put headers there manually (strongly not recommended) or add search path to the location that you know the headers must be at:
Now as there were two headers cocos2d.h and MyStaticLibrary.h, cocos2d.h was successfully imported although it will have additional dependency.
The path ../MyStaticLibrary/build/$(BUILD_STYLE)-$(PLATFORM_NAME) will also (recursively) have public headers of the library.
After almost 5 days of a nightmare trying to solve that, I finally found this tutorial: http://www.youtube.com/watch?v=XUhLETxgcoE
This is the only solution that worked for me. The simplest and the best.
Thanks for every one trying to solve this.
Please try this…
step1: right click on the 'projectName.xcodeproj'(static library).Choose 'Get info' and copy the full path from(General->where)
step2: Paste full path to 'Header search paths' for your main project(Both Targets and Project )

Creating an IPA, "contains multiple products"

I am working on an email client based on ReMail. Basically, I reused the ReMail project so that the MailCore etc dependencies would be all set up out of the box so I could build a new app on top of them. I'm trying to give the app to some beta testers via ad hoc, but when I try to create an IPA, I receive this error:
xxxx does not contain a single–bundle application or contains multiple products. Please select another archive, or adjust your scheme to create a single–bundle application.
I have set Skip Install to YES for all dependencies, and moved all files under Copy Header to the "project" section, but I am still unable to build a single APP file.
I don't know if this is significant, but when I open up the xcarchive file, within the products directory, I find a the APP file under Applications, and then a file structure mirroring the absolute path to the header files for MailCore.
Any ideas as to what might be going on? I'm very near the tearing-out-chunks-of-hair-in-frustration stage, and I don't think the unnaturally bald crazy person look would suit me.
Thanks!
Try removing the “Copy Headers” phase entirely. It's only supposed to be used for frameworks, not static libraries. The Xcode static library template that includes a “Copy Headers” phase is wrong.
Check out the “Working with Schemes and Projects in Xcode” video from WWDC 2012, starting at 45m10s.

Validate causes error during Uploading iphone application

I am trying to upload an iphone application.In the last step I created an archive file and it also available in the organizer window.But when l clicks validate button it shows error.
"My Application does not contain a single–bundle application or contains multiple products. Please select another archive, or adjust your scheme to create a single–bundle application."
In my application have no static libraries .
Please give me a solution...
Thanks in advance
First of all go to the Build Settings, set the "Skip Install" to "Yes" and then
Under the Build Phases, examine the Copy Headers section. If there are any header files listed as Private or Public, drag them down to the Project section.

how to implement facebook in my application for iPhone

I have complete code for implemention for facebook in my application But the problem arises as follow :
Firstly whenever i import FBConnect\FBConnect.h the error will show that it doesn't "NO such file or direectory"
secondly due to this error i have 182 error in my application..
Thanks
You need to tell the compiler where to find the header files; in XCode, this is called "Header Search Path". You will also have linker errors later if the libraries aren't accessible.
Find "Header Search Paths" in build settings. Enter full path of the facebook sdk src folder(upto the folder-facebook-iphone-sdk/src) there.
This is assuming you have copied the reference of the FBConnect folder in your project and not the files themselves.
I tried by copying the files directly, but couldn't do so. Following the facebook developer wiki word by word would solve your problem.
Take care to see that your file name is correct..if so then check it out that that the file is present in the correct directory..