I wanted to try out PLActorKit for iPhone: http://code.google.com/p/plactorkit/
but I still get the error, that classes from this framework can't be found.
I downloaded the the .dmg file and added the ActorKit.framework to my project. In the class I want to use the framework I wrote
#import <ActorKit/ActorKit.h>
in the .h file.
When I try to use classes from the ActorKit framework in my .m file I still get the error
*_OBJC_CLASS_$_PLActorKit*, referenced from: Objc-class-ref-to-PLActorKit in myClass.o
Symbol(s) not found
I don't know what I did wrong.
where are the headers located? if they are in your classes directory then try using:
#import "ActorKit/ActorKit.h"
else you need to add the directory containing the headers to the headers search path. for whatever reason it can't currently find the headers, or the static framework/project isn't being built. you may have to set it up as a direct dependency.
Related
So, when my data model is ready, I tried to generate the subclasses when my data model file is open:
Editor -> Create NSManaged Object Subclasses
Okay, two files are generated, one is class declaration, the other is the property.
However, I was immediately prompted that I did a redeclaration of a class that already exists. This is where the original generated files are:
previously generated files
My question is obvious:
When were those two files generated?
What to do if I want those files in my project navigator, and, of course, the same folder as my ViewController?
It is common to make changes to an existing entity on the core data model.
Assume you add a field to an existing entity in the core data model, you would have to regenerate the class for that entity to include that field.
When regenerating that class there would be a an option to overwrite the existing files.
To answer your questions:
It was probably created when the previous entity change was made.
Move the previously generate files to the desktop. Then generate new files. See what the difference between the 2 sets of files are and take appropriate action. If I am not wrong, one file would be an extension and one is a class file.
You are generating files which have already been generated for you by Xcode and thus get duplicate declarations.
Find detailes in this answer.
So, the correct answer seems like the one who commented on my question. Original post is here: https://stackoverflow.com/a/39933534/5642467.
Delete all generated NSManagedObject subclasses from your project, if exists.
Set Codegento Manual/None in your .xcdatamodel for all entities
Clean project.---This is the key step, which is by default set to automatic by Xcode8.
Clean DerivedData folder
Restart Xcode
Manually generate NSManagedObject subclasses (in "Editor" menu)
Make sure those files are added to your project
build
If your problem persists, repeat:
Clean project
Clean DerivedData folder
Restart Xcode
In your xcdatamodeld you have to modify the Entity Class Codegen to Manual/None in the Utilities Panel before compile
When I have imported the SDWebImage framework into my project.
I get 2 warning messages.
They all say 'Duplicate definition of category "WebCache" on interface "UIImageView" '
Besides, there is one also shown 'In module "WebImage" import from <built-in>:1: '
How to hide or make sure it won't show out anymore?
Note:
The Framework imported, and linked with binary files. And I'am using swift so that I linked the bridge as well -> "#import 《SDWebImage/UIImageView+WebCache.h》 "
Use #import SDWebImage; instead of #import <SDWebImage/UIImageView+WebCache.h> (not just in the bridge file but anywhere in your project).
If I have a structure:
/app/views/tags/tag1.scala.html
/app/views/mystuff/tags/tag2.scala.html
Then, inside tag2.scala.html
#import tags._ // this refers to /app/views/mystuff/tags
#import _root_.tags._ // I want it refers to /app/views/tags
Then I have an error: object tags is not a member of package
Q: what is the best practice to handle imports if the view-structure is deeper than one level ?
REMARK:
I've already read that _root_ can not be imported. But how can I refer to the root then?
UPDATE:
If I try this (not to use root):
#import views.tags._
#import views.mystuff.tags._
Then I have error: object tags is not a member of package views
For now I follow different structure:
tags/tag1.scaa.html
tags/mystuff/tag2.scala.html
and this of course works (maybe this is even better).
Another idea is to create separate play module. Or even different (rest) application.. depending on what 'stuff' is in each concrete case.
So this is alternative solution, I don't know how to refer to root in that case:
The package "views" need to be the last in structure path, so you must change your structure from:
/app/views/mystuff/tags/tag2.scala.html
to:
/app/mystuff/tags/views/tag2.scala.html
I'm writing a dart file:
import 'something.dart'
part of my_lib;
class A{
//...
}
I have tried this with the import and part of directives reversed and it still won't work, can you not have a class file as part of a library and have imports?
All your imports should go in the file that defines the library.
Library:
library my_lib;
import 'something.dart';
part 'a.dart';
class MyLib {
//...
}
a.dart
part of my_lib;
class A {
//...
}
Since a.dart is part of my_lib it will have access to any files that my_lib imports.
The Pixel Elephanr's answer is correct, but I suggest the alternative syntax for the part-of directive:
my_file.dart
(the library main file):
//This now is optional:
//library my_lib;
import 'something.dart';
part 'a.dart';
class MyLib {
//...
}
a.dart
(part of the same library; so in it you can reference the elements imported in my_file.dart)
//Instead of this (whitout quotes, and referencing the library name):
//part of my_lib;
//use this (whit quotes, and referencing the library file path):
part of 'my_file.dart'
class A {
//...
}
In the Doc you can found both the syntax, but only using the part-of's syntax with quotes (pointing to the file path), you can omit the library directive in the library main file; or, if the library directive is still needed for other reasons (to put doc and annotations to library level), at least you won't be forced to keep in sync the library name in multiple files, which is boring in case of refactoring.
If you are facing this in IntelliJ IDEA or Android Studio while moving the files via drag and drop, then switch to 'Project Source' in project pane at left and then move(drag and drop). When I faced this problem while working with flutter, this worked for me.
I added the Facebook sdk code to my project then I got this error because I already had a json library, so I deleted the Facebook json library from my computer and from the project but I still get this error. I search the whole project for "#interface SBJsonBase" and I only get one result. How can it say it's a duplicate when I only have one interface? Is it including the file twice? Does the search not always find everything?
May be this helps? Delete your derived data and do a clean project, then try to build again
I had a simular problem. It was a small search, but I could solve it without creating a new project etc...
The thing was I had a Class B that was importing Class A.
Then I had a class that imported Class B and also Class A.
When I did this, these problems occured.
Eg. A SOAP webservice Class imports all the Entities that are passed over the web.
Class goToSchoolWebservice.
import "person.h"
import "school.h"
...
Then I had a Singleton class used for caching that had the Logged in Person and also a ref to the webservice class.
import "person.h"
import "goToSchoolWebservice.h"
--> this is where is went wrong!!
So watch out for these circular references. ITs not so easy to detect them!
if your using #include instead of import then use this technique to minimize duplicates: at the begining of your interface (actually right before it) do check for a definition and if not defined then define it and proceed to define your interface. here is an example:
#ifndef __NetworkOptionsViewController__H // check if this has every been imported before
#define __NetworkOptionsViewController__H
#import "blahblah.h"
#interface NetworkOptionsViewController : UITableViewController
{
NSMutableArray* somevariable1;
int somevariable2;
}
#end
#endif
-- for me personally, i got this error though because the file path to my class was wrong. I checked file inspector and my class file was not defined in Classes folder even though the IDE said it was. I deleted them and copied them over again.
For those that still get this error, despite following header import conventions: I got this error from importing a header that had been deleted from the project. The missing header was instead found in an old backup of my project in dropbox (That I made before doing some destructive stuff in Git), and that file caused the circular import.
I solved a similar problem by moving all the imports to the prefix header file.