AVAudioUnitComponentManager won't instantiate - osx-yosemite

When I add this line of code (to an empty new OS X 10.10 project):
AVAudioUnitComponentManager *manager = [AVAudioUnitComponentManager
sharedAudioUnitComponentManager];
I get this exception:
Failed to set (contentViewController) user defined inspected property
on (NSWindow): -[__NSCFString substringWithRange:]: Range {0,
18446744073709551615} out of bounds; string length 3
Any ideas?

Related

My position coordinate, invoke virtual method on a null object reference

In one of the fragments of my app I am trying to get the coordinates of my current position but when I try to save them in a variable this is not possible because I get a reference to a null object. I think the reason is a matter of time, my position is not initialized before being saved in the variable. How can I make sure this happens before saving it in the variable? what am I doing wrong?
This is the function i tried to get it coordinates
fun routePathPosi(){
myLocationNewOverlay = MyLocationNewOverlay(GpsMyLocationProvider(context), mapView)
myLocationNewOverlay.enableMyLocation()
myLocationNewOverlay.isDrawAccuracyEnabled = true
val a: Double = myLocationNewOverlay.myLocation.latitude
val b: Double = myLocationNewOverlay.myLocation.longitude
println("my location is : $a and $b")
}
this is my error
E/AndroidRuntime: FATAL EXCEPTION: main
Process: uk.co.lorenzopulcinelli.navigationdrawer, PID: 32684
java.lang.NullPointerException: Attempt to invoke virtual method 'double org.osmdroid.util.GeoPoint.getLatitude()' on a null object reference
at uk.co.lorenzopulcinelli.navigationdrawer.NavFun.routePathPosi(NavFun.kt:90)
at uk.co.lorenzopulcinelli.navigationdrawer.CreatePathFragment.onCreateView$lambda-3(CreatePathFragment.kt:98)
at uk.co.lorenzopulcinelli.navigationdrawer.CreatePathFragment.$r8$lambda$wqVLFXUeXU7qjx0UlbTvNIoGrJQ(Unknown Source:0)
at uk.co.lorenzopulcinelli.navigationdrawer.CreatePathFragment$$ExternalSyntheticLambda2.onClick(Unknown Source:2)
at android.view.View.performClick(View.java:7185)
at com.google.android.material.button.MaterialButton.performClick(MaterialButton.java:1194)
at android.view.View.performClickInternal(View.java:7162)
at android.view.View.access$3500(View.java:819)
at android.view.View$PerformClick.run(View.java:27678)
at android.os.Handler.handleCallback(Handler.java:883)
at android.os.Handler.dispatchMessage(Handler.java:100)
at android.os.Looper.loop(Looper.java:224)
at android.app.ActivityThread.main(ActivityThread.java:7590)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:539)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
I/Process: Sending signal. PID: 32684 SIG: 9

Error using Accelstepper library in PlatformIO mbed

I have successfully instantiated my accelstepper objects:
//Create accelstepper object for the Z-Axis actuator
AccelStepper zaxis(AccelStepper::DRIVER, ZSTEP, ZDIR);
//Create accelstepper object for the theta axis actuator
AccelStepper taxis(AccelStepper::DRIVER, TSTEP, TDIR);
//Create accelstepper object for the magnet actuator
AccelStepper maxis(AccelStepper::DRIVER, MSTEP, MDIR);
Now I am trying to do some basic setup with these objects:
void stepper_setup(){
//Set Max Speed in steps per second
zaxis.setMaxSpeed(100);
taxis.setMaxSpeed(100);
maxis.setMaxSpeed(100);
//Set Acceleration in steps per second squared
zaxis.setAcceleration(500);
taxis.setAcceleration(500);
maxis.setAcceleration(500);
//Home the Zaxis, Taxis, Maxis
zaxis.moveTo(100000); taxis.moveTo(100000); maxis.moveTo(100000);
zaxis.run(); taxis.run(); maxis.run();
However, the compiler throws me the following error:
.pio\build\nucleo_f410rb\lib799\libAccelStepper.a(AccelStepper.o): In function `AccelStepper::runSpeed()':
c:\Users\USER\Documents\PROJECTFOLDER\Codes\PROJECT TITLE/.pio\libdeps\nucleo_f410rb\AccelStepper/AccelStepper.cpp:63: undefined reference to `t'
collect2.exe: error: ld returned 1 exit status
*** [.pio\build\nucleo_f410rb\firmware.elf] Error 1
and when look up the problematic line 63 in AccelStepper.cpp in question, i can only find this line:
_currentPos -= 1;
This is the picture of the problematic line and
This is the picture of the error thrown in the compiler
which doesn't make sense. Am I missing something? Any help would be greatly appreciated!

iOS9 Storyboard "Setting empty vector for variable" exception - Terminating app due to uncaught exception 'NSInternalInconsistencyException'

I'm running into an issue where my main storyboard got corrupted after I messed around with it, and I get the following cryptic error message. The app catches error in main() and is followed by SIGABRT with the following exception:
Terminating app due to uncaught exception 'NSInternalInconsistencyException',
reason: '{objective 0x147dc56e0: <1:-25.3333> + <1:1>*0x147dc39b0.posErrorMarker{id: 91} +
<1:0.125>*0x147dc50e0.negError{id: 90} +
<1:-0.125>*0x147e2e300.marker{id: 77} +
<1:0.125>*0x147e2e300.slack{id: 78} +
<1:0.125>*0x147e2e350.marker{id: 81} +
<1:-1>*0x147e2e440.marker{id: 87} +
<1:-0.125>*0x147e436b0.marker{id: 63} +
<1:0.125>*0x147e437f0.marker{id: 72} +
<1:-0.125>*0x147e764c0.marker{id: 55} +
<1:0.125>*0x147e88820.marker{id: 52}}:
internal error. Setting empty vector for variable 0x147dc1b90.negError{id: 48}.'
Setting another storyboard to be the main interface has the app starting up correctly.
How can I find the element that is causing "Setting empty vector for variable" storyboard exception?
In case it helps anyone else, I was getting an Setting empty vector for variable error with use of a UIStackView where the spacing property was not set.
Not sure if it's the actual cause, or just a weird correlation, but setting spacing to a non-zero value prevents this error for me.
try using po 0x147dc1b90 in the debugger console, where 0x147dc1b90 is your variable address, which you can see in the last line, to see more details
For me it was calling self.view.layoutIfNeeded() without main queue was the issue.
DispatchQueue.main.async {
self.view.layoutIfNeeded()
}

NSFormatter and NSTokenField and setting the maximum length

I would like to use a custom NSFormatter to judge the length of a string inside of a NSTokenField.
I have implemented the NSFormatter and hooked it up within the xib and all that, now when I get to running my application with the formatter inplace connected to the NSTokenField I get this error:
2011-12-31 18:15:11.761 MyApp[4706:a0f] -[NSCFArray length]: unrecognized selector sent to instance 0xf4a530
(gdb) describe 0xf4a530
Undefined command: "describe". Try "help".
(gdb) p 0xf4a530
$1 = 16033072
(gdb) po 0xf4a530
<NSCFArray 0xf4a530>(
{
Format = "%01d";
FormatIndex = 0;
Name = "$Counter$";
},
{
Format = "";
Name = hey;
}
)
Now I understand that indeed the textcell being evaluated contains an array of items so I will need to probably turn these to a string but the place where this is erroring in my code is here:
//Set this so that user can't enter a super long amount and overflow the character array lower in the engine.
[fieldFormatter setMaximumLength:40];
Im just evaluating the fieldFormatter object and setting its member variable of int to 40... really shouldnt be evaluating the text yet... right?

making an apple-scriptable application in Objective C, getting bizarre errors

Ok, so I've got an application, and I want to make it scriptable. I set up the plist, I set up the sdef file.
So far I have only one apple Event command: gotoPage. it takes an integer. and returns a boolean.
The relevant XML is:
<command name="gotoPage" code="dcvwgoto" description="Goto a specified page">
<cocoa class="AEGoto"/>
<direct-parameter description="Page Number" type="integer"/>
<result description="True if the page exists, False othrewise" type="boolean"/>
</command>
I have an Objective-C class AEGoto.h:
#interface AEGoto :NSScriptCommand {
}
- (id)performDefaultImplementation;
- (id)performDefaultImplementation
{
int page = [[self directParameter] intValue];
Boolean retval = [gController setPage: page];
return retval? #"YES" : #"NO";
}
setPage: (int) is correct, and works fine.
When I call this, my program seems to work correctly. But then I get the error:
error "DocView got an error: 4 doesn’t understand the gotoPage message." number -1708 from 4
I also get, in my DocView output:
Error while returning the result of a script command: the result object... YES ...could not be converted to an Apple event descriptor of type 'boolean'. This instance of the class 'NSCFString' doesn't respond to -scriptingBooleanDescriptor messages.
However, if I return just the straight Boolean, I get:
Single stepping until exit from function -[NSScriptingAppleEventHandler handleCommandEvent:withReplyEvent:],
which has no line number information.
Program received signal: “EXC_BAD_ACCESS”.
so, I guess I've got 2 questions: 1) Why does it think it wants to tell 3 to goto a page? and 2) what is the correct way to return a Boolean from the applescript?
thanks.
return [NSNumber numberWithBool:retval];