setValue:forUndefinedKey: issue that makes no sense UIActivityIndicatorView - ios6

In ViewController.m I am allocating a class like so:
myClass = [[MyClass alloc]init];
but when I set a breakpoint in that class it's throwing an exception before it even hits ViewDidLoad of:
[<MyClass 0x1a4a60> setValue:forUndefinedKey:]: this class is not key value coding-compliant for the key activityIndicator.'
But the thing is the class doesn't use an interface file and there is not a single UIActivityIndicatorView in the entire project. Can some please help, I have spent hours trying to address this and it makes no sense to me.

Related

'MyMethod' in 'Dao_Impl' clashes with 'MyMethod + extends' in 'Dao'; both methods have same erasure, yet neither overrides the other

I wasnt getting any errors before. But today, i entered my project to edit and saw these errors.
First one is on this line;
public final class NoteDao_Impl implements NoteDao {
// The error code is : Class 'NoteDao_Impl' must either be declared abstract or implement abstract method 'getAllNotes(Continuation<? super List<? extends Notes>>)' in 'NoteDao'
I can fix it with Alt + Enter and then clicking 'implement methods' but just in case i want to write it.
The second one and third one is on these lines;
#Override
// Error : Method does not override method from its superclass
public Object getAllNotes(final Continuation<? super List<Notes>> continuation) {
// Error : 'getAllNotes(Continuation<? super List<Notes>>)' in 'com.ahmetkaan.kediy.data.NoteDao_Impl' clashes with 'getAllNotes(Continuation<? super List<? extends Notes>>)' in 'com.ahmetkaan.kediy.data.NoteDao'; both methods have same erasure, yet neither overrides the other
The NoteDao;
package com.ahmetkaan.kediy.data
import androidx.room.*
#Dao
interface NoteDao {
#Query("SELECT * FROM notes ORDER BY id DESC")
suspend fun getAllNotes() : List<Notes>
#Query("SELECT * FROM notes WHERE id =:id")
suspend fun getSpecificNote(id:Int) : Notes
#Query("SELECT * FROM notes WHERE category = :id")
suspend fun getCategoryNote(id:Int) : Notes
#Insert(onConflict = OnConflictStrategy.REPLACE)
suspend fun insertNotes(note:Notes)
#Delete
suspend fun deleteNote(note:Notes)
#Query("DELETE FROM notes WHERE id =:id")
suspend fun deleteSpecificNote(id:Int)
#Update
suspend fun updateNote(note:Notes)
}
The problem appears when i set getAllNotes() method as "getAllNotes() : List " So i guess thats why. But i dont understand why i get this error now. I do some research and i encounter some solutions like;
public class a<T extends Comparable> implements A<T>
but probably i cant make it compatible with my project :,) Thanks in advance.
I met the same problem. I try this link to fix the problem.
You can try changing List<Notes> to Array<Notes>.
Hope it will help.
Also, if this error causes your app to crash at runtime, and you don't want to change the List to Array, maybe there is another approach. If you are using manual migration of the room database, try to change it to auto migration(Doc). Although there still has this error in the build package, it won't affect your app performance. Your app can run without crashing.

PageInit does not work when on different class

As the title says I am using PageFactory to initialize my elements.
When I use PageFactory.initElements on the page I want to use my elements everything is fine and works correctly, but when I try to create a new class with PageFactory to have it initialize all elements there I get a null pointer exception.
Below you will find the code I am using:
Actions.java
TestIds testIds = new TestIds();
public void initElements(WebDriver driver) {
PageFactory.initElements(driver, cashierIds);
}
The above lines work when included in my Actions class but when I create a new Class called ElementInitialization.java, move everything in it and then call it my elements throw nullPointerException.
Is there a different way to call the specific faction to work everywhere?

Dynamic Array as Class Property in VBScript

I am very new to VBScript, and not entirely sure if what I am doing is right.
I want to create a structure to hold onto a string and then an array of strings. The array of string will be dynamic, as I do not know how many entries are going to be in that list.
I have the following:
Class ExportMappings
Private _process_definition
Private _export_mappings : Set _export_mappings = CreateObject("System.Collection.ArrayList")
Public Property Let ProcessDefinition(procDef)
_process_definition= procDef
End Property
Public Property Get ProcessDefinition()
ProcessDefinition = _process_definition
End Property
Public Property Let ExportMappings(export)
_export_mappings = export
End Property
Public Sub AddMapping(map)
_export_mappings.Add map
End Sub
End Class
First, I am not sure if I declared the _export_mapping array properly.
Secondly, I do not know if I need a constructor to initialize my _export_mappings to an initial size. If so, I do not know how I would do that.
Lastly, my get and set methods for ExportMapping, I am not sure if that will work.
I would try to run it through a debugger, but the software I am using does not have the best debugger, and usually gives me a very vague description of what is wrong.
First things first:
VBScript variable names can't start with _; you can 'legalize' invalid names by putting them in [], but for starters I wouldn't do this
Code in Classes is allowed in methods only; your Private _export_mappings : Set _export_mappings = CreateObject("System.Collection.ArrayList") is invalid
After these changes, your code should compile. If you add code showing how you'd like to use this class, I'm willing to talk about second things (maybe tomorrow).

How to get Apex class that implements the Schedulable interface?

I have many classes that implement Schedulable Interface. I want to schdule multiple Apex classes at a time through an another apex class. So I need to query all the classes that are implement Schedulable interface.
I am using the following code snipet to achieve this, but I am getting a compiler error like below
ERROR:
"You must select an Apex class that implements the Schedulable interface. at line 127 column 13"
CODE:
list<ApexClass> listClasses;
String input='0 0 8 13 2 ?';
listClasses=[Select Id, Name,body from ApexClass]
for(ApexClass a:listClasses){
system.schedule(a.Name+' AutoScheduler', input, a);
}
Question:
How do I query all the apex class which implement schedulable interface? So that I can directly pass it to system.schedule() method.
DIFFERENT TRY:
When after getting this error I tried to query only one apex class(Known Class) which implements schedulable interface. Again no use. Please see the below snipet for the different try
CODE:
list<ApexClass> listClasses;
String input='0 0 8 13 2 ?';
//Retriving only one class of Name='SchedularTest'
listClasses=[Select Id, Name,body from ApexClass where Name ='SchedularTest']
for(ApexClass a:listClasses){
system.schedule(a.Name+' AutoScheduler', input, a);
}
ERROR:
"You must select an Apex class that implements the Schedulable interface. at line 127 column 13"
Thanks in advance
Satheeskumar
I'd say the error message is quite clear?
The last parameter you're passing to System.schedule has to be a new object. New instance of the class. What you're passing is the metadata information about the class, it's body etc... This stuff can't be "run" like that.
I'm going to bet that system.schedule('SchedulerTest AutoScheduler', input, new SchedulerTest()); will work OK? If it doesn't - make sure the class compiles OK and maybe also whether it is marked as valid.
See? how do you expect something that represents a row in the database / file on disk to "work" like an object of the class?
If you need to create a new object of given class having only this class' name - you might want to check Type methods.
String className = 'SchedulerTest';
Type t = Type.forName(className);
System.schedule(className, '0 0 8 13 2 ?', (Schedulable)t.newInstance());
This makes a new object (it's actually a generic Object) and then you cast it to something that's acceptable for the method. You'll get a runtime failure if the class doesn't implement the interface:
System.TypeException: Invalid conversion from runtime type
SchedulerTest to system.Schedulable

GAE JDO: default fetch group member null on second read

I have a persistable class like this:
#PersistenceCapable(detachable = "true")
public class MyClass {
...
#Persistent(defaultFetchGroup = "true")
#Element(dependent = "true")
private Set<Key> mySet = new HashSet<Key>();
...
}
Which I first persist and then read back like so:
pm.getFetchPlan().setGroup(FetchPlan.DEFAULT);
pm.getFetchPlan().setMaxFetchDepth(1);
myInstance = pm.getObjectById(MyClass.class, key);
What's bizarre is that this works fine the first time after a server restart. However, the second time I make the query, mySet remains null.
I have been trying the same with an ArrayList, but no luck. I'm completely clueless as to what might cause behaviour like this, so any vague pointers as to what may be the cause would be greatly appreciated.
Update:
I found a fix, but I don't understand why it works. If I add a copy constructor for User and copy the instance after the read, it works consistently. I would assume that there's a cache that always hands me back the same instance, but stepping through the program, I can't find any code that would set roles to null. Is this likely to be a side effect I'm overlooking or is there a more fundamental issue that I'm not understanding?

Resources