SDWebImage/UIImageView+WebCache.h File Not Found Error - iphone

I Integrated SDWebImage in my project , its work like a charm in my mac system but while i am sending my project to other mac system its showing error like SDWebImage/UIImageView+WebCache.h File Not Found but the same project working in my system .some time i i am also getting the same error in my mac system after running the project continuously for 2 to 3 days
i tried all the ways like changing path to  project>target>Build Settings>'header search paths>$(SOURCE_ROOT)/SDWebImage
also tried $(BUILT_PRODUCTS_DIR) -  In header search paths,
please give me the some suggestions to solve my problem
Thanks in Advance

its only because the added SDWebimaege in your project its only reference so add folder of SDWebimages demo project in your project folder
and i am configure SDwebimage like this way:-
you need to first right click on your project name:->add files to yourProject-> selected SDWebImageproject and add them
NOTE:- please do not check copy option
now click on project name in Your xcode going to build phases:->target dependencies:-> click on + button and add SDWebimage ARC
now select link binary with library click + button add libSDWebimageARC.a and again click + and add imageIO.framework and also add libxml2.dylib thats it
going to Build setting:->other link flag:-> add -ObjC
and header search path add this three item
1 /usr/include/libxml2
2 "$(OBJROOT)/UninstalledProducts/include"
3 "$(TARGET_BUILD_DIR)/usr/local/lib/include"
now build and run its working like smoothly cheers.... :)

just try heading this in your frameworks path as well:
$(SDKROOT)/Developer/Library/Frameworks

Related

Cannot add Alamofire to Swift Project

Trying to add alamofire to swift project using unstruction from here
Did all these steps, clean project a lot of timer and restarted XCode, nothing helps. Error does not dissappear
http://i.stack.imgur.com/kNU3R.png
"Cannot load underlying module for 'Alamofire'" and nothing to do
Changes I did:
1) added project file to my project
i.stack.imgur.com/eUe8E.png
2) added to build phases panel
i.stack.imgur.com/1wanl.png
3) added to general tab
i.stack.imgur.com/L3TTR.png
What`s wrong with that?
I had the same problem. I was able to fix it by doing the following.
Download the Alamofire "Source" folder.
https://github.com/Alamofire/Alamofire/tree/master/Source
Drag it into your xCode Project, and click "Copy Items if Needed". If you view the project in Finder, the Alamofire Source folder should be in the project itself. (Ex: I have 3 items. Example App, Example App.xcodeproj, Example App Tests. The folder should be in Example App.)
Finally, you should be done! However, now, you do not need to import Alamofire, since you are not actually loading a framework.
For example, instead of doing Alamofire.upload, you will now only do upload.

www folder not found after i created cordova based application in xcode

I created a Cordova based application in XCode, and when I tried to the www folder of my project I did not find it.
Can anyone advise me where to find the www folder that should be included in the project?
Check the tutorial provided by the online doc very carefully:
http://docs.phonegap.com/en/1.5.0/guide_getting-started_ios_index.md.html#Getting%20Started%20with%20iOS
Normally, when creating your project, you should have turned off the ARC:
In case you forgot to turn the ARC off, you may try the following:
Select your project file.
Select the Build settings tab, and select the filter options All and levels (default is Combined).
In the search field to the right of the filter option Combined, enter automatic.
There will be a group called Apple LLVM Compiler 3.0 – Language containing the line Objective-C Automatic Reference Counting.
Click that line, then in the middle column (where it says yes), click and choose no.
The above should turn your ARC off.
Then, try following the next steps of the project creation:
You should see your project in Xcode 4 now. Press the Run button in
the top left corner. Your build should succeed and launch in the
simulator
You should see a error in your simulator informing you
index.html was not found
To fix this, we need to copy the www
directory into the project. Right click on the project in the left
navigation window and click show in finder
In Finder, you should see
the www directory beside your project
Next step is IMPORTANT! Drag the www folder into Xcode 4. You can't
just drag the www folder into your app's folder. It needs to be
dragged into Xcode 4!! In my case I would drag it and drop it on
HiWorld shown below.
After you drag, you should see a prompt with a few options. Make sure
to select Create folder references for any added folders. Click Finish
Continue from step 4.HelloWorld of the online doc...
Hope this helps.

SDWebImage/UIImageView+WebCache.h file not found while archiving [duplicate]

I am fairly new to ios development - trying to use sdwebimage in my iphone project. I believe I completed all basic setups as required. But when I build, I get this error: No such file file or directory near this line:
#import "UIImageView+WebCache.h"
Yes I have added Target Dependencies
I have added libSDWebImage.a in Link Binary With Libraries
I have -all_load -ObjC in Other Linker Flags
I also tried the -force_load ${BUILT_PRODUCTS_DIR}/libSDWebImage.a (64bit mac)
My Use Header Search Paths is : $(BUILT_PRODUCTS_DIR)
I cleaned the project and rebuilt - but no use.
Build keeps failing. Again, XCode4 code completion "resolves" when I type #import "UI & hit "ctrl+space" which means the lib is visible to xcode. Any pointers will be super helpful. Thanks.
To add the needed header files to the build path do the following.
Select your project file
Select your target
Select Build settings
In the search box enter 'header search paths'
For the Release add "$(SOURCE_ROOT)/SDWebImage" (thats with quotes).
This will work when importing like this #import <SDWebImage/UIImageView+WebCache.h>
I also use SDWebImage.
In my experience I didn't do anything with the linker flags etc.
You only have to add the classes in your project and simply import the "UIImageView+WebCache.h" in your class' header like this:
#import "UIImageView+WebCache.h"
and if you want to use it on an UIImageView object, just use the method
setImageWithURL:placeholderImage:
you can refer to their github for more info
I just ran into this problem and have solved it.
The issue is that when you "drag" the SDWebImage xcode project to your project, Xcode only create a reference to point to those files needed. When you are in debug mode it's fine, it knows where to find those file. However, when you want to archive it (packing everything to be self-contained), it couldn't find it from your search path.
Although you have added $(BUILT_PRODUCTS_DIR) to your search path, but if the actual files that you downloaded are not physically located in your $(BUILT_PRODUCTS_DIR), then Xcode won't find them. This was the problem for me since my SDWebImage files were still sitting in my download folder.
What you want to do is:
1.Move the SDWebImage folders to a place where you won't accidentally delete it. Notice once you've done that, the SDWebImage project file will become red since it's physical location is moved. And it's wired that I could not delete that reference in Xcode, what I ended up doing is add that file again (choosing from the location where I just move it too). You will end up with a red SDWebImage.xcodeproj in your project navigator which you can not delete. It's very annoying but it won't affect anything.
2. If the location you move the SDWebImage stuff to is not in your $(BUILT_PRODUCTS_DIR), then you either move that inside $(BUILT_PRODUCTS_DIR) or as I do, add the path to Target -> Build Settings -> Search Paths -> User Header Search Paths.
Archive and it should work now.
I faced this same problem and was about to go crazy. Like Ravi, I followed the static installation instructions as closely as possible.
I saw the auto suggest for UIImageView+WebCache.h when I was typing #import, but it keeps throwing file not found.
In the end, it was this. In header search paths,
“$(BUILT_PRODUCTS_DIR)” - Wrong.
$(BUILT_PRODUCTS_DIR) - Right.
Embarrassed but now it's working right =)
I've been dealing with this problem for the past hour and noticed something that hasn't been mentioned: Make sure that when you up update header search paths that the "Recursive" option is selected! Otherwise the compiler will not check subfolders.
Worked for me...
I was dealing with the same problem, my two frameworks were not getting found. I tried all the suggested ways in order to resolve the error but it couldnt help. Atlast I deleted the frameworks from my project structure and reloaded them from the original project file and it worked!! Please try this if it helps, It worked for me...
I had a similar issue after pod update. If you are using CocoaPods version higher than 1.0.0 and more than one target in your project, you have to add all the targets into the Podfile.

How to add Twitter oauth to iPhone project?

I'm trying to add this: https://github.com/bengottlieb/Twitter-OAuth-iPhone
The readme doesn't give a step by step so I just tried dragging the whole folder into my project and then when I try to compile I get a file not found error on #include
What do I do?
I found the solution, it's on the bottom of this page: http://www.cocos2d-iphone.org/forum/topic/6136
In order to get your project to compile you’ll need to first include the libxml2 Framework (right click on your project and choose Add Exisiting Frameworks).
Now right click on your project and choose ‘Get Info’. In the build tab, scroll down till you see the ‘Search Paths’ section. In the ‘Header Search Paths’ field, add ‘$(SDKROOT)/usr/include/libxml2′
Finally, expand the Twitter+OAuth group in your project and then expand theMGTwitterEngine group. Open MGTwitterEngine.m and alter #define USE_LBXML 0 to #define USE_LIBXML 1.
you will have to add the following frameworks
libxml
And edit the header search path in the project settings to include
"$(SDK_DIR)"/usr/include/libxml2
For further info please read the following
LibXML2.dylib and Xcode4

How to change Xcode Project name

I have developed my app in Xcode for iPhone, in start I have just named it without secnec now I want to change my app name I have replace my old app name with new one as I have found the name in my app, but its still giving me one error...
Desktop/New name/old name_Prefix.pch: No such file or directory
when I have change oldname_prefix.pch with newname_prefix.pch ..
For Xcode 4 or later:
Open a project
Select Project Navigator
Highlight project name
Single click on project name
For Xcode 3:
Open a project > Menu > Project > Rename ...
There is no need to change the name of the project in order to change the display name of the application (which is what you see on the home screen of the iOS device, in iTunes, etc.). Simply change the "Bundle display name" in your info.plist from the default "${PRODUCT_NAME}" to whatever you want it to be. The name of your project is invisible to users, they only see the "Bundle display name."
click on you project in project explorer and again click on your project on right side and there you can see project name as shown in the figure
On the left side expand Targets
Double click on your target and then select build tab in the newly opened window
on the top right there is a search box. Type - "Product Name"
Now look below, under packaging section, you will see Product Name
Change it and clean rebuild, your new app name should be changed by now.
Goto
youname-Info.plist
Change Both
Bundle name and Bundle display name to your preferred file name.
Done.
For changing application name only (that will display along with app icon) in xcode 4 or later:
Click on your project file icon from Groups & Files panel, choose Target -> Build Settings -> Packaging -> Product Name.
Click on the row, a pop-up will come, type your new app name here.
For changing Project name only (that will display along with project icon) in xcode 4 or later:
Click on your project file icon from Groups & Files panel, choose Project(above targets) from right pane, just see at the far right pane(it will be visible only if you have enabled "Hide or show utilities").Look for project name.Edit it to new name you want to give your project.
Delete your app from simulator/device, clean and run.Changes should reflect.
That's it
ohho's answer is perfect:
For Xcode 4 or later:
Open a project
Select Project Navigator
Highlight project name
Single click on project name
BUT, if you only do this, once you try to debug on a new device, you will find an error:
file not found: /Users/someuser/Library/Developer/Xcode/DerivedData/OLDNAME-akbwbarcniqxytctbebckkelkbxs/Build/Products/Debug-iphonesimulator/OLDNAME.app/OLDNAME
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Then you need to do one more step:
Select target on the left panel
Choose the oldnameTests in Targets
Select the Build Settings Panel
Search for "TEST_HOST" and change the old value to the new.
Good Luck and Have Fun
Here is Apple's step by step visual guide to change name of Xcode project.
To change name of workspace just rename it.
in xcode 4.4, you have to click on the project at the top of the navigator (left panel). Then click twice on the target in the second column to highlight the target name. Then you can change the product name. You will also need to modify the archive name when you go to create an archive. To do this, you must edit the scheme, click on Release, and then change the archive name.
I am using xcode 4.3.1 and tried to change product name as Quakeboy said above in the bundle setting, but it led to reading error. I was stuck in this error for an hour and now it is working well. I simply made the product name blank then retype the older name that I had before. building succeeded again!
Note to anyone who like to change project name : you don't have to change the project file name the bundle display name will be display to users so just don't hang out with this issue too much. can be wasting time.
It creates an organizational nightmare to have project names that don't match the bundled name. But when I use the "click on project name and answer yes to let xcode rename all of the references" technique, all of the nested folders for the project on my hard drive still have the old project name. Why aren't they renamed to match?
If I change those folder names, I'm pretty sure it will mess up all of the project links. I am not going to take the chance, unless someone can suggest a way around this.
Select the project in the Project Navigator (Command+1) and open the File Inspector in the right sidebar (Command+option+1).
There, change the Project Name.
Xcode 3.2.5:
In top menu bar, Project>Rename...
I tried by changing the Project name in Project Navigator, but you need to follow through with the all the step outlined here!!!.
I did not follow the second step and this broke my app, had to rework a older version which took two days, see my SO post here.
I tried ohho's answer and it didn't work but found another solution. You can open your Info.plist file and go where it says' "Bundle Name" and change to your new name that will be shown in your launcher. I hope this wrks
Simple step
1.Select the project target left side on top of all folders and files
2.Single click on the project again it will allow you to change the name
3.type as u want the name of the project and the name of the app
4.Press enter. it will ask to change every where accept it
5.same procedure do on the folder as well all place the name will be changed. i did it today
Just in case this helps someone, I have a shell script (xcmv.sh) with the following:
#!/usr/bin/env bash
mv $1 $2
mv $1.xcodeproj $2.xcodeproj
mv $1.xcworkspace $2.xcworkspace
LC_ALL=C find ./ -type f -not -path "./.git*" -exec sed -i '' "s/${1}/${2}/g" {} +
I then drag this file into the project directory and do:
sh xcmv.sh Starter MyProject
This changes the project name, the workspace name, plus any and all references to the old name in the project files, code files, plist, and so on.
As the sample indicates, I often use it to rename one of my various "starter" projects to the desired project name.
Note the git directory (if it exists) is ignored.
This video shows a developer renaming an Xcode 6 project. First single-click the project name to change it, then make sure to also set the host application for your test build target.
https://www.youtube.com/watch?v=ZHr1vjkTxC0