DejalActivityView and indicator view errors - iphone

I am trying to integrate dejalactivityview indicator view in my application, and I am running into this error:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_DejalActivityView", referenced from:
objc-class-ref in WelcomeMessage.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
This library is pretty easy to integrate and I am pretty sure I did everything correctly: added the .m and .h files, my project is ARC enabled and thats how I call the method:
[DejalActivityView activityViewForView:self.view];
Pretty simple, no? Still doesn't work...thanks for the help!
UPDATE:
I tried this:
DejalActivityView *testvc;
[testvc activityViewForView:self.view];
But I am getting an error (before compiling) that "no visible #interface for "DejalActivityView" declares selector 'activityViewForView:self.view'"

OK, I got the same thing just now. It seems if you simply drag the .m and .h files into your project, the .m file won't be added as source to link to your project, hence the link errors. What solved this for me was adding the DejalActivityView.m source file into the "Compile Sources" section under "Build Phases" of the project target. In other words, go to the Project Navigator and click on the uppermost item, then select the "Build Phases" tab, and then add the .m file to the "Compile Sources" section. Build and run your project again, and this time it should not have the linker errors!

what's your class name? make sure u spell correctly if again not work then change the class name. cz it some times that your class name matches with some built in name or some method name in project already in use

Check if you have actually copied the .m and .h files or you are just referencing them. Compiler might not be able to compile these files if you have not copied them to your project folder.

check this for
"no visible #interface for "DejalActivityView" declares selector 'activityViewForView:self.view'"
reply:- No need for a property for the DejalActivityView
please import this file in your viewcontroller .m
#import "DejalActivityView.h"
and write this code in viewdidload and check
[DejalActivityView activityViewForView:self.view];
if you have any error after that implement the download this from this link and implement , i use and work my code

Related

"_OBJC_CLASS_$_MDAudioPlayerTableViewCell" & linker command failed with exit code 1 (use -v to see invocation) [duplicate]

I am trying to implement the SVProgressHUD activity indicator. I copied the classes to my project and added the following code to my appDelegate but can't figure out why it crashes.
I get they following error and am not sure where to look to fix it:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SVProgressHUD", referenced from:
objc-class-ref in QuotesAppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is the code:
#import "SVProgressHUD.h"
#implementation QuotesAppDelegate
- (void)startLoading
{
//call this in your app delegate instead of setting window.rootViewController to your main view controller
//you can show a UIActivityIndiocatorView here or something if you like
[SVProgressHUD show];
[self performSelectorInBackground:#selector(loadInBackground) withObject:nil];
}
- (void)loadInBackground
{
//do your loading here
//this is in the background, so don't try to access any UI elements
[self populateFromDatabase];
[SVProgressHUD dismiss];
[self performSelectorOnMainThread:#selector(finishedLoading) withObject:nil waitUntilDone:NO];
}
- (void)finishedLoading
{
//back on the main thread now, it's safe to show your view controller
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
}
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[self copyDatabaseIfNeeded];
[self startLoading];
}
Edit
The answer I provided (see My original answer) only fixes the problem, but it's not the correct solution. For correct solutions see Jim answer
It sounds like SVProgressHUD.m isn't enabled for your target. Click on
it in the project navigator in the left-hand pane, then look in the
file inspector in the right-hand pane to make sure there's a tick next
to the target you are building.
or Parth Bhatt link.
For the sake of completeness
Experimenting a little bit, I found that when you drag and drop file or directory within your project, Xcode (4.3.1) asks you to select the right option to add those files or dir to your project. Make sure that that "Add to targets" option is checked.
If you have missed to check that option, you need to following these steps:
Select YourProjectName
Select TARGETS
Select Build Phases
Add .m classes in Compile Sources section
My original answer
If you dragged those classes in your project, it could be the problem.
To avoid that compiling error, use "Add Files to YourProjectName" instead.
Suppose you have a directory that contains .h and .m files called "SVProgressHUD" in your desktop.
Now you have to:
Remove previous files (both .h and .m)
Click with right click in your project
Select "SVProgressHUD" dir with "Add Files to YourProjectName" (select the following check box options: Destination Copy items... and Folders Create groups for any...)
Hope it helps.
It sounds like SVProgressHUD.m isn't enabled for your target. Click on it in the project navigator in the left-hand pane, then look in the file inspector in the right-hand pane to make sure there's a tick next to the target you are building.
Checkout this link. Refer to accepted answer in this link:
Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error
If it still doesnt help then refer to Allen Pike's answer in the above link. try removing and adding back QuartzCore framework in your app.
Hope this helps you.
check if you have any objects that you could previously delete without knowing it
check if your all objects are connected , for example if you have a MapView but without a connection, it crashes down
if this doesn't work, try with cleaning the app, or just restarting your iPhone and Xcode
I resolved this issue by changing in Player Settings in the Unity Editor.
menu path:
PlayerSettings > OtherSettings > Scripting Backend change to IL2CPP from Mono2x.
Second change was to change the Architecture to universal.

"Apple Mach-O linker command failed with exit code 1"

I am trying to implement the SVProgressHUD activity indicator. I copied the classes to my project and added the following code to my appDelegate but can't figure out why it crashes.
I get they following error and am not sure where to look to fix it:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_SVProgressHUD", referenced from:
objc-class-ref in QuotesAppDelegate.o
ld: symbol(s) not found for architecture i386
clang: error: linker command failed with exit code 1 (use -v to see invocation)
Here is the code:
#import "SVProgressHUD.h"
#implementation QuotesAppDelegate
- (void)startLoading
{
//call this in your app delegate instead of setting window.rootViewController to your main view controller
//you can show a UIActivityIndiocatorView here or something if you like
[SVProgressHUD show];
[self performSelectorInBackground:#selector(loadInBackground) withObject:nil];
}
- (void)loadInBackground
{
//do your loading here
//this is in the background, so don't try to access any UI elements
[self populateFromDatabase];
[SVProgressHUD dismiss];
[self performSelectorOnMainThread:#selector(finishedLoading) withObject:nil waitUntilDone:NO];
}
- (void)finishedLoading
{
//back on the main thread now, it's safe to show your view controller
[window addSubview:[navigationController view]];
[window makeKeyAndVisible];
}
- (void)applicationDidFinishLaunching:(UIApplication *)application {
[self copyDatabaseIfNeeded];
[self startLoading];
}
Edit
The answer I provided (see My original answer) only fixes the problem, but it's not the correct solution. For correct solutions see Jim answer
It sounds like SVProgressHUD.m isn't enabled for your target. Click on
it in the project navigator in the left-hand pane, then look in the
file inspector in the right-hand pane to make sure there's a tick next
to the target you are building.
or Parth Bhatt link.
For the sake of completeness
Experimenting a little bit, I found that when you drag and drop file or directory within your project, Xcode (4.3.1) asks you to select the right option to add those files or dir to your project. Make sure that that "Add to targets" option is checked.
If you have missed to check that option, you need to following these steps:
Select YourProjectName
Select TARGETS
Select Build Phases
Add .m classes in Compile Sources section
My original answer
If you dragged those classes in your project, it could be the problem.
To avoid that compiling error, use "Add Files to YourProjectName" instead.
Suppose you have a directory that contains .h and .m files called "SVProgressHUD" in your desktop.
Now you have to:
Remove previous files (both .h and .m)
Click with right click in your project
Select "SVProgressHUD" dir with "Add Files to YourProjectName" (select the following check box options: Destination Copy items... and Folders Create groups for any...)
Hope it helps.
It sounds like SVProgressHUD.m isn't enabled for your target. Click on it in the project navigator in the left-hand pane, then look in the file inspector in the right-hand pane to make sure there's a tick next to the target you are building.
Checkout this link. Refer to accepted answer in this link:
Undefined symbols for architecture i386: _OBJC_CLASS_$_SKPSMTPMessage", referenced from: error
If it still doesnt help then refer to Allen Pike's answer in the above link. try removing and adding back QuartzCore framework in your app.
Hope this helps you.
check if you have any objects that you could previously delete without knowing it
check if your all objects are connected , for example if you have a MapView but without a connection, it crashes down
if this doesn't work, try with cleaning the app, or just restarting your iPhone and Xcode
I resolved this issue by changing in Player Settings in the Unity Editor.
menu path:
PlayerSettings > OtherSettings > Scripting Backend change to IL2CPP from Mono2x.
Second change was to change the Architecture to universal.

Undefined symbols for architecture armv6, Updating to iOS 4.3

I am patching upp an application from iOS 4.2 to 4.3 using new xcode4.
With no changes made, except setting iOS to 4.3, I created entitlements and go!
Message I get is:
Undefined symbols for architecture armv6:"function", referenced from:
Ive tried to Clean the project, reinstalling xcode.
I uninstalled also the xcode4 demo version.
I also tried to set to Optimized armv7.
I would be very happy for some help, I'm stuck. Really.
Thanks very much in advance!
Here's how I got this problem:
I added a .h, .m and NIB from another project by dragging them onto my project navigator. Xcode didn't add them to the Build Phases properly.
My solution for this problem:
Click on the Project icon
Go to the Target in the navigator menu
Click on the "Build Phases" tab
Add the .m file to "Compile Sources" (either drag it across, or use the + button)
Add the .xib or Storyboard file to "Copy bundle resources"
Clean and build
For this type of error, this is what I typically see:
Undefined symbols for architecture armv6:
"_OBJC_CLASS_$_MyCustomController", referenced from:
objc-class-ref in SomeOtherController.o
ld: symbol(s) not found for architecture armv6
Almost every time I see this error it is caused by hidden/invisible characters in the import statement in SomeOtherController.h or SomeOtherController.m. So, look at both your .h and .m file, find the line that looks like this:
#import "MyCustomController.h"
Delete this line and retype it (do not copy/paste it -- you'll just repaste the offending hidden character).
Click on your Project name in the navigation window, choose the target you're building against, go to build phases, make sure the one Xcode's telling you that's missing is in there.
I had the same problem in Xcode5 for iOS7 with the TestFlight SDK. My issue was that the 'Build Active Architecture Only' was set to Debug only.
You can find the setting under 'YourProject'->'Build Settings'->'Architectures' Set the 'Release' option to 'Yes'.
This solved my problem - I hope it helps you, too! :)
I had this problem and I have just solved it.
It was a simple typo in the function name (forgot one letter) that caused the problem in my case.
I had the same problem in Xcode5 for iOS7 with the TestFlight SDK. My issue was that the 'Build Active Architecture Only' was set to Debug only.
You can find the setting under 'YourProject'->'Build Settings'->'Architectures' Set the 'Debug ' option to 'architecure arm7 arms7s'.
This solved my problem - I hope it helps you, too! :)
I had a similar issue popping-up all suddenly - more specifically, I was getting Undefined symbols for architecture armv6: "_OBJC_CLASS_$_CLLocationManager", referenced from: objc-class-ref in MyCLController.o
Note that I had CoreLocation.framework listed in my frameworks (in xcode' Project left nav, under the Frameworks folder); and had previously geolocation working just fine.
I got rid of the issue by re-installing CoreLocation.framework.
If you're not sure how to do that in xcode:
* click on your project in xcode left nav bar
* Go in the General tab of your project settings
* Navigate down - you'll see the list of frameworks installed under Linked Frameworks and Libraries
* Click on the + icon to add the CoreLocation.framework
In my case, I was doing this in a viewcontroller.m
#import <MediaPlayer/MediaPlayer.h>
Without doing Link Binary With Libraries with MediaPlayer.framework. After adding it, it compiled fine

iOS Development: Why can't my linker see my class?

I just added a class to my Xcode project and the linker is giving me this error...
_OBJC_CLASS_$_MyCustomViewController", referenced from:
objc-class-ref-to-MyCustomViewController in MainMenuViewController.o
In MainMenuViewController.h, I have #import "MyCustomViewController.h"
and I have both MyCustomViewController.h and .m files in the project. What are some reasons my linker would have trouble seeing the class?
Thanks so much for you wisdom!
Ensure that your .m files are being included in the chosen target. To do this:
Right-click on "Groups & Files" (above your file list on the left) and click "Target Membership". Checkboxes should appear to the left of many of your files, particularly your .m files. Make sure that MyCustomViewController.m has its checkbox checked, and then rebuild.

iPhone - Using Reachability throwing duplicate symbol _OBJC_IVAR error

I have added the Apple Reachability files to my project and I am already getting errors. I have NOT even added these files to any of my classes, only added them to my project. How could I already be getting this error?
When compiling I get the following error:
ld: duplicate symbol _OBJC_IVAR_$_Reachability.localWiFiRef in /Users/webmaster/Dropbox/iPhone-Development/Official-Projects/PUC/build/PUC.build/Debug-iphonesimulator/PUC.build/Objects-normal/i386/Reachability-B40F6D608A62C635.o and /Users/webmaster/Dropbox/iPhone-Development/Official-Projects/PUC/build/PUC.build/Debug-iphonesimulator/PUC.build/Objects-normal/i386/Reachability-823B59DA9A9B0D23.o
collect2: ld returned 1 exit status
Command /Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin/gcc-4.2 failed with exit code 1
Note: I am using the Three20 project, so I am not sure if it could be conflicting somehow?
So, I figured it out. I realized that since I am using ShareKit, it also includes Reachability, so it WAS in my project twice, I just didn't realize it.
You need to #import your custom class's .h in your .m. Otherwise the #import "Reachability.h" is happening twice and, I'm guessing, there is a variable called localWiFiRef defined in Reachability.h that now is beind declared twice and hence the "duplicated symbol" error.
When doing that, you will not need to #import "Reachability.h" in the .m.