DOH!!! MANY THANKS
I just knew it would be a nooby mistake.
Must admit other than that I’d had very few difficulties in creating my app.
I Look forward to many hours of writing them.
Welcome!
This is the community forum for my apps Pythonista and Editorial.
For individual support questions, you can also send an email. If you have a very short question or just want to say hello — I'm @olemoritz on Twitter.
Consultant Engineer, semi professional tinkerer who loves problem solving. Spare time Creator of quiz related programs such as timing and buzzer kits.
DOH!!! MANY THANKS
I just knew it would be a nooby mistake.
Must admit other than that I’d had very few difficulties in creating my app.
I Look forward to many hours of writing them.
Hi Gents
Well its still an ongoing saga.. I seem to have got something wrong. The app worked well until I archived it and then when I pushed up to apple it came back with a bunch of errors. So started to look through the code and tried to build it again and then it started giving the following error and failing the build.
ld: warning: ignoring file /Users/schilds/Desktop/PythonistaAppTemplate- Master/PythonistaAppTemplate/PythonistaKit.framework/PythonistaKit, missing required architecture x86_64 in file /Users/schilds/Desktop/PythonistaAppTemplate- Master/PythonistaAppTemplate/PythonistaKit.framework/PythonistaKit (2 slices)
Undefined symbols for architecture x86_64:
"OBJC_CLASS$_PAConsoleImageView", referenced from:
objc-class-ref in libpythonista_appui.a(PAStandaloneOutputView.o)
"_CanvasGetImage", referenced from:
-[PAStandaloneOutputView canvasFlushed:] in libpythonista_appui.a(PAStandaloneOutputView.o)
"_IsWaiting", referenced from:
-[PAStandaloneOutputView textFieldShouldReturn:] in libpythonista_appui.a(PAStandaloneOutputView.o)
"_LineRead", referenced from:
-[PAStandaloneOutputView textFieldShouldReturn:] in libpythonista_appui.a(PAStandaloneOutputView.o)
"OBJC_CLASS$_PythonInterpreter", referenced from:
objc-class-ref in PAAppDelegate.o
objc-class-ref in libpythonista_appui.a(PAStandaloneOutputView.o)
"OBJC_CLASS$_PAEExtensionContext", referenced from:
objc-class-ref in PAAppDelegate.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
I don't think its the template but any suggestions please...
Thanks
Ive wrapped set values and a few others, I'm pulling most of the v[..] stuff out of main and wrapping them. I think you're right about it being a warning as I messed up a cut and paste and got a completely different response all in red.
if the wrapping don't work I'll disable mtc and get it on test pilot. they can only complain lol.
Many thanks jonB.
HI Gents
Right I've played with the on_main_thread and the ui.in)background and its made no difference.
what I have found is that its the v.present('sheet') command that's causing the problem, I have printed the error messages below
=================================================================
Main Thread Checker: UI API called on a background thread: -[UIView subviews]
PID: 11972, TID: 374078, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4 PythonistaKit 0x00000001047e1247 View_get_view + 214
5 PythonistaKit 0x00000001047ecb1f View_mapping_get_item + 61
6 PythonistaKit 0x00000001046e1c25 PyEval_EvalFrameEx + 15881
7 PythonistaKit 0x00000001046e4159 fast_function + 282
8 PythonistaKit 0x00000001046de3de PyEval_EvalFrameEx + 1474
9 PythonistaKit 0x00000001046ddbda PyEval_EvalCodeEx + 1576
10 PythonistaKit 0x00000001046dd5ac PyEval_EvalCode + 54
11 PythonistaKit 0x0000000104773710 run_mod + 53
12 PythonistaKit 0x00000001047737b3 PyRun_FileExFlags + 133
13 PythonistaKit 0x0000000104773302 PyRun_SimpleFileExFlags + 698
14 PythonistaKit 0x00000001046b203a -[PythonInterpreter runWithOptions:] + 2265
15 PythonistaKit 0x00000001046b2363 -[PythonInterpreter doDispatchBlockOnInterpreterThread:] + 97
16 Foundation 0x00000001052acc7b __NSThreadPerformPerform + 330
17 CoreFoundation 0x00000001061da721 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
18 CoreFoundation 0x00000001061d9f93 __CFRunLoopDoSources0 + 243
19 CoreFoundation 0x00000001061d463f __CFRunLoopRun + 1263
20 CoreFoundation 0x00000001061d3e11 CFRunLoopRunSpecific + 625
21 Foundation 0x0000000105297322 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
22 Foundation 0x0000000105297534 -[NSRunLoop(NSRunLoop) runUntilDate:] + 143
23 Foundation 0x00000001052ac732 __NSThread__start__ + 1221
24 libsystem_pthread.dylib 0x000000010d19633d _pthread_body + 126
25 libsystem_pthread.dylib 0x000000010d1992a7 _pthread_start + 70
26 libsystem_pthread.dylib 0x000000010d195425 thread_start + 13
2018-11-15 16:21:54.014317+0000 My App[11972:374078] [reports] Main Thread Checker: UI API called on a background thread: -[UIView subviews]
PID: 11972, TID: 374078, Thread name: (none), Queue name: com.apple.root.default-qos.overcommit, QoS: 0
Backtrace:
4 PythonistaKit 0x00000001047e1247 View_get_view + 214
5 PythonistaKit 0x00000001047ecb1f View_mapping_get_item + 61
6 PythonistaKit 0x00000001046e1c25 PyEval_EvalFrameEx + 15881
7 PythonistaKit 0x00000001046e4159 fast_function + 282
8 PythonistaKit 0x00000001046de3de PyEval_EvalFrameEx + 1474
9 PythonistaKit 0x00000001046ddbda PyEval_EvalCodeEx + 1576
10 PythonistaKit 0x00000001046dd5ac PyEval_EvalCode + 54
11 PythonistaKit 0x0000000104773710 run_mod + 53
12 PythonistaKit 0x00000001047737b3 PyRun_FileExFlags + 133
13 PythonistaKit 0x0000000104773302 PyRun_SimpleFileExFlags + 698
14 PythonistaKit 0x00000001046b203a -[PythonInterpreter runWithOptions:] + 2265
15 PythonistaKit 0x00000001046b2363 -[PythonInterpreter doDispatchBlockOnInterpreterThread:] + 97
16 Foundation 0x00000001052acc7b __NSThreadPerformPerform + 330
17 CoreFoundation 0x00000001061da721 __CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE0_PERFORM_FUNCTION__ + 17
18 CoreFoundation 0x00000001061d9f93 __CFRunLoopDoSources0 + 243
19 CoreFoundation 0x00000001061d463f __CFRunLoopRun + 1263
20 CoreFoundation 0x00000001061d3e11 CFRunLoopRunSpecific + 625
21 Foundation 0x0000000105297322 -[NSRunLoop(NSRunLoop) runMode:beforeDate:] + 277
22 Foundation 0x0000000105297534 -[NSRunLoop(NSRunLoop) runUntilDate:] + 143
23 Foundation 0x00000001052ac732 __NSThread__start__ + 1221
24 libsystem_pthread.dylib 0x000000010d19633d _pthread_body + 126
25 libsystem_pthread.dylib 0x000000010d1992a7 _pthread_start + 70
26 libsystem_pthread.dylib 0x000000010d195425 thread_start + 13
and its saying that there is no thread name and its therefore calling it a background call. I put the call into a def and on_main_thread but the message does not change.
@on_main_thread
def setscreen(v,stdtime):
#v=ui.load_view('cql.pyui')
v.present('sheet')
v.background_color = '#00ffff'
label4 = v['label4']
label5 = v['label5']
console.set_idle_timer_disabled(True)
def main():
state=load_state('setup.json')
stdtime = state
load_timers(timer1,timer2,stdtime)
# print timer1,timer2
v = ui.load_view('cql')
v.background_color = '#00ffff'
.
.
#v.present('sheet')
setscreen(v,stdtime)
onscreen = v.on_screen
if onscreen is False:
console.set_idle_timer_disabled(False)
return False
Note not full code shown see previous post for gist.
Any thoughts? The code works - its just this error I can't get rid of!
so before every def addressing the ui use the on_main_thread decoration. 👍
The console commands I had #’d out that’s why it’s not faulting in that version I sent but I’ll post the screenshot tomorrow.
Many thanks for you help guys.
https://gist.github.com/2dda361f2c076e2c584d8e93012cfdb2
If I’ve done it correctly it should be there. For some reason I kept getting status code 0 like last time and then it sailed through.
It might have a few decorators in the wrong places as I’ve been experimenting.
Errr.. moved into main() which stopped most of the original errors except this one. Sounds like I’ve now gotta learn objtc_utils.
Any good pointers to an idiots guide? Or an example please.😁
Update
I have down graded my code to 2.7 (many thanks mikael ) and have it sitting in Xcode and working on simulator and my iPhone, with a helping hand from jonB to get the TextField behaving properly so I’m ready to upload to the App Store apart from two persistent errors in Xcode which say
1, I’m calling to ui from not main thread, I have moved all calls into the main but still have one error remaining.
2 calling console time out disabled from outside main thread
Annoyingly I can’t get rid of them, any ideas
Have you tried calling the split keyboard on the iPad - press g & h together and pull apart, there must be a function to make it do this through coding but I’m not that good!!! More than likely one of our community members may know.
Oops the pyui code snippet is from the full program not the simplified version I sent you. As you can tell not genius level at python unlike your good self. However i’m excellent at other things like 3D cad and printing so if ever I can repay the favour just let me know.
Ok I see what your saying, if I ever get my head round the class thing, the more I get out of the loop the better.
I do like the update suggestion as well and have included that now as well.
Cheers
Many Many thanks JonB, the class did the trick and its functioning perfectly.
I've put it in the main body of my program and its sorted out the issue fully.
the setting of the tv.action has made sure my function works a treat.
You mentioned that the while true may cause a problem, is this something you have come across before?
cheers
Gadgettyke